textbook.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import BaseStore from '@src/stores/base';
  2. export default class TextbookStore extends BaseStore {
  3. listPaper(params) {
  4. return this.apiGet('/textbook/paper/list', params);
  5. }
  6. searchQuestion(params) {
  7. return this.apiGet('/textbook/question/search', params);
  8. }
  9. listQuestion(params) {
  10. return this.apiGet('/textbook/question/list', params);
  11. }
  12. getNextQuestion(params) {
  13. return this.apiGet('/textbook/question/next', params);
  14. }
  15. getQuestion(params) {
  16. return this.apiGet('/textbook/question/detail', params);
  17. }
  18. addQuestion(params) {
  19. return this.apiPost('/textbook/question/add', params);
  20. }
  21. editQuestion(params) {
  22. return this.apiPut('/textbook/question/edit', params);
  23. }
  24. delQuestion(params) {
  25. return this.apiDel('/textbook/question/delete', params);
  26. }
  27. listLibrary(params) {
  28. return this.apiGet('/textbook/library/list', params);
  29. }
  30. addLibrary(params) {
  31. return this.apiPost('/textbook/library/add', params);
  32. }
  33. editLibrary(params) {
  34. return this.apiPut('/textbook/library/edit', params);
  35. }
  36. listHistory(params) {
  37. return this.apiGet('/textbook/library/history/list', params);
  38. }
  39. postHistory(params) {
  40. return this.apiPost('/textbook/library/history/post', params);
  41. }
  42. listTopic(params) {
  43. return this.apiGet('/textbook/topic/list', params);
  44. }
  45. addTopic(params) {
  46. return this.apiPost('/textbook/topic/add', params);
  47. }
  48. editTopic(params) {
  49. return this.apiPut('/textbook/topic/edit', params);
  50. }
  51. delTopic(params) {
  52. return this.apiDel('/textbook/topic/delete', params);
  53. }
  54. getTopic(params) {
  55. return this.apiGet('/textbook/topic/detail', params);
  56. }
  57. getNextTopic(params) {
  58. return this.apiGet('/textbook/topic/next', params);
  59. }
  60. }
  61. export const Textbook = new TextbookStore({ key: 'textbook' });