textbook.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import BaseStore from '@src/stores/base';
  2. export default class TextbookStore extends BaseStore {
  3. /**
  4. * 所有机经信息
  5. */
  6. getInfo() {
  7. return this.apiGet('/textbook/info');
  8. }
  9. /**
  10. * 获取机经进度
  11. */
  12. progress() {
  13. return this.apiGet('/textbook/progress');
  14. }
  15. /**
  16. * 机经组卷列表
  17. */
  18. listPaper({ page, size, latest, logic, finish }) {
  19. return this.apiGet('/textbook/paper/list', { page, size, latest: !!latest, logic, times: finish });
  20. }
  21. listYear(year) {
  22. return this.apiGet('/textbook/year', { year });
  23. }
  24. allHistory(subject) {
  25. return this.apiGet('/textbook/history/all', { subject });
  26. }
  27. noTopic(libraryId, subject, no) {
  28. return this.apiGet('/textbook/topic/no', { libraryId, subject, no });
  29. }
  30. listTopic({ page, size, latest, subject, keyword, quality, isOld, order, direction }) {
  31. return this.apiGet('/textbook/topic/list', { page, size, latest, subject, keyword, quality, isOld, order, direction });
  32. }
  33. subscribe(subscribe) {
  34. return this.apiPost('/textbook/subscribe', { subscribe });
  35. }
  36. enroll(date) {
  37. return this.apiPost('/textbook/enroll', { date });
  38. }
  39. unEnroll() {
  40. return this.apiPost('/textbook/enroll/cancel');
  41. }
  42. listEnroll(startDate, endDate) {
  43. return this.apiGet('/textbook/enroll/list', { startDate, endDate });
  44. }
  45. }
  46. export const Textbook = new TextbookStore({ key: 'textbook' });