import BaseStore from '@src/stores/base'; export default class MyStore extends BaseStore { /** * 绑定邮箱 * @param {*} email 邮箱 */ bindEmail(email) { return this.apiPost('/my/email', { email }); } /** * 绑定手机 * @param {*} area * @param {*} */ bindMobile(area, mobile, mobileVerifyCode) { return this.apiPost('/my/mobile', { area, mobile, mobileVerifyCode }); } /** * 修改用户信息 * @param {*} info nickname avatar */ editInfo(info) { return this.apiPost('/my/info', { ...info }); } /** * 发送邀请码到邮箱 * @param {*} emails */ inviteEmail(emails) { return this.apiPost('/my/invite/email', { emails }); } getVipInfo() { return this.apiGet('/my/vip/info'); } /** * 用户站内信 * @param {*} page * @param {*} size * @param {*} messageType * @param {*} read */ message({ page, size, messageType, read }) { return this.apiGet('/my/message', { page, size, messageType, read }); } /** * 读取用户消息/全部 */ readAllMessage() { return this.apiPut('/my/message/read', { all: true }); } /** * 读取用户消息 */ readMessage(id) { return this.apiPut('/my/message/read', { all: false, id }); } /** * 清除最后一次练习记录 */ clearLatestExercise() { return this.apiPut('/my/clear/exercise/latest').then(() => { this.setState({ info: { latestExercise: 0 } }); }); } /** * 清除最后一次错误组卷记录 */ clearLatestError() { return this.apiPut('/my/clear/error/latest').then(() => { this.setState({ info: { latestError: 0 } }); }); } /** * 修改备考信息 * @param {*} info prepareStatus: 身份 prepareGoal: 目标分数 prepareExaminationTime: 考试时间 prepareScoreTime: 出分时间 */ editPrepare(info) { return this.apiPut('/my/prepare', { ...info }); } /** * 获取备考信息 */ getPrepare() { return this.apiGet('/my/prepare'); } /** * 获取学习记录 * @param {*} date 时间 */ getStudy(date) { return this.apiGet('/my/study', { date }); } /** * 获取每周学习记录 * @param {*} week 0本周,1上周 */ getStudyWeek(week) { return this.apiGet('/my/study/week', { week }); } /** * 获取总学习记录 */ getStudyTotal() { return this.apiGet('/my/study/total'); } /** * 添加心经收藏 * @param {*} experienceId */ addExperienceCollect(experienceId) { return this.apiPut('/my/collect/experience/add', { experienceId }); } /** * 删除收藏 * @param {*} experienceId */ delExperienceCollect(experienceId) { return this.apiDel('/my/collect/experience/delete', { experienceId }); } /** * 获取收藏心经列表 * @param {*} page * @param {*} size * @param {*} startTime * @param {*} endTime * @param {*} order * @param {*} direction */ listExperienceCollect({ page, size, startTime, endTime, order, direction }) { return this.apiGet('/my/collect/experience/list', { page, size, startTime, endTime, order, direction }); } /** * 添加题目收藏 * @param {*} questionNoId */ addQuestionCollect(questionNoId) { return this.apiPut('/my/collect/question/add', { questionNoId }); } /** * 删除题目收藏 * @param {*} questionNoId */ delQuestionCollect(questionNoId) { return this.apiDel('/my/collect/question/delete', { questionNoId }); } /** * 收藏题目移除 * @param {*} ids: questionId */ clearQuestionCollect(questionNoIds) { return this.apiDel('/my/collect/question/clear', { questionNoIds }); } /** * 收藏卷组 * @param {*} questionNoIds: 'questionNoId' * @param {*} filterTimes */ groupQuestionCollect({ questionNoIds, filterTimes }) { return this.apiPost('/my/collect/question/group', { questionNoIds, filterTimes }); } /** * 获取收藏题目列表 * @param {*} page * @param {*} size * @param {*} startTime * @param {*} endTime * @param {*} order */ listQuestionCollect({ keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order }) { return this.apiGet('/my/collect/question/list', { keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order }); } /** * 获取错题列表 * @param {*} page * @param {*} size */ listError({ keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }) { return this.apiGet('/my/error/list', { keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }); } /** * 错题组卷 * @param {*} questionNoIds: 'questionNoId' * @param {*} filterTimes */ groupError({ questionNoIds, filterTimes }) { return this.apiPost('/my/error/group', { questionNoIds, filterTimes }); } /** * 错题移除 * @param {*} ids: userQuestionId */ clearError(questionNoIds) { return this.apiPost('/my/error/clear', { questionNoIds }); } /** * 移除正确题 * @param {*} userReportId */ removeError(userReportId) { return this.apiPost('/my/error/remove', { userReportId }); } /** * 获取学习数据 * @param {*} module * @param {*} subject * @param {*} structIds * @param {*} startTime * @param {*} endTime */ getData(module, subject, structIds, startTime, endTime) { return this.apiGet('/my/data', { module, subject, structIds, startTime, endTime }); } /** * 获取题目笔记 * @param {*} questionNoId */ getQuestionNote(questionNoId) { return this.apiGet('/my/note/question', { questionNoId }); } /** * 更新题目笔记 * @param {*} questionNoId * @param {*} content * @param {*} qxContent * @param {*} officialContent * @param {*} associationContent * @param {*} qaContent */ updateQuestionNote(questionNoId, { content, questionContent, qxContent, officialContent, associationContent, qaContent }) { return this.apiPut('/my/note/question', { questionNoId, content, questionContent, qxContent, officialContent, associationContent, qaContent }); } clearQuestionNote(questionNoIds) { return this.apiPost('/my/note/question/clear', { questionNoIds }); } /** * 获取笔记列表 * @param {*} page * @param {*} size * @param {*} startTime * @param {*} endTime * @param {*} order */ listQuestionNote({ keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }) { return this.apiGet('/my/note/question/list', { keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }); } /** * 更新课程笔记 * @param {*} courseId * @param {*} courseNoId * @param {*} content */ updateCourseNote(courseId, courseNoId, content) { return this.apiPut('/my/note/course', { courseId, courseNoId, content }); } clearCourseNote(courseNoIds) { return this.apiPost('/my/note/course/clear', { courseNoIds }); } /** * 获取笔记列表 * @param {*} page * @param {*} size * @param {*} startTime * @param {*} endTime * @param {*} order */ listCourseNote({ keyword, courseId, page, size, order, direction }) { return this.apiGet('/my/note/course/list', { keyword, courseId, page, size, order, direction }); } /** * 获取报告列表 * @param {*} origin * @param {*} structId * @param {*} page * @param {*} size * @param {*} startTime * @param {*} endTime * @param {*} order */ listReport({ keyword, module, origin, questionTypes, structIds, latest, year, courseModules, page, size, startTime, endTime, order }) { return this.apiGet('/my/report/list', { keyword, module, origin, questionTypes, structIds, latest, year, courseModules, page, size, startTime, endTime, order }); } /** * 添加题目提问 * @param {*} userQuestionId : 用于获取预习作业,判断权限 * @param {*} target * @param {*} questionNoId * @param {*} content */ addQuestionAsk(userQuestionId, target, questionNoId, originContent, content) { return this.apiPost('/my/ask/question', { userQuestionId, target, questionNoId, originContent, content }); } /** * 删除题目提问 * @param {*} id */ delQuestionAsk(id) { return this.apiDel('/my/ask/question/delete', { id }); } listQuestionAsk({ keyword, module, questionTypes, structIds, latest, year, answerStatus, page, size, startTime, endTime, order }) { return this.apiGet('/my/ask/question/list', { keyword, module, questionTypes, structIds, latest, year, answerStatus, page, size, startTime, endTime, order }); } /** * 添加课程提问 * @param {*} courseId * @param {*} courseNoId * @param {*} position * @param {*} originContent * @param {*} content */ addCourseAsk(courseId, courseNoId, position, originContent, content) { return this.apiPost('/my/ask/course', { courseId, courseNoId, position, originContent, content }); } /** * 删除课程提问 * @param {*} id */ delCourseAsk(id) { return this.apiDel('/my/ask/course/delete', { id }); } listCourseAsk({ keyword, courseId, courseNoId, answerStatus, order, direction }) { return this.apiGet('/my/ask/course/list', { keyword, courseId, courseNoId, answerStatus, order, direction }); } /** * 添加题目勘误 * @param {*} questionNoId * @param {*} title * @param {*} position * @param {*} originContent * @param {*} content */ addFeedbackErrorQuestion(questionNoId, title, position, originContent, content) { return this.apiPost('/my/feedback/error/question', { questionNoId, title, position, originContent, content }); } /** * 添加数据勘误 * @param {*} dataId * @param {*} title * @param {*} position * @param {*} originContent * @param {*} content */ addFeedbackErrorData(dataId, title, position, originContent, content) { return this.apiPost('/my/feedback/error/data', { dataId, title, position, originContent, content }); } /** * 添加机经反馈 * @param {*} textbookSubject * @param {*} target * @param {*} no * @param {*} content */ addTextbookFeedback(textbookSubject, target, no, content) { return this.apiPost('/my/feedback/textbook', { textbookSubject, target, no, content }); } /** * 添加考场反馈 * @param {*} roomId * @param {*} content */ addRoomFeedback(roomId, content) { return this.apiPost('/my/feedback/ready/room', { roomId, content }); } /** * 添加Faq * @param {*} channel * @param {*} position * @param {*} content */ addFaq(channel, position, content) { return this.apiPost('/my/faq', { channel, position, content }); } /** * 添加评论 * @param {*} channel * @param {*} position * @param {*} content */ addComment(channel, position, content) { return this.apiPost('/my/comment', { channel, position, content }); } /** * 资料全局订阅开关 * @param {*} subscribe */ subscribeDataEmail(subscribe) { return this.apiPost('/my/data/email/subscribe', { subscribe }); } /** * 资料订阅开关 * @param {*} dataId * @param {*} subscribe */ subscribeData(dataId, subscribe) { return this.apiPost('/my/data/subscribe', { dataId, subscribe }); } /** * 获取资料更新列表 * @param {*}} param0 */ listDataHistory({ page, size, dataId }) { return this.apiGet('/my/data/history', { page, size, dataId }); } /** * 获取购买资料列表 * @param {*} param0 */ listData({ page, size, structId, dataType, order, direction }) { return this.apiGet('/my/data/list', { page, size, structId, dataType, order, direction }); } /** * 购买的课程列表 * @param {*} param0 */ listCourse({ page, size, courseModule, isUsed, isEnd, order, direction }) { return this.apiGet('/my/course/list', { page, size, courseModule, isUsed, isEnd, order, direction }); } detailCourse(recordId) { return this.apiGet('/my/course/detail', { recordId }); } setCCTalkName(id, cctalkName) { return this.apiPost('/my/course/cctalk_name', { id, cctalkName }); } uploadAppointmentQuestion({ id, questionFile, questionFileName }) { return this.apiPost('/my/course/appointment/question', { id, questionFile, questionFileName }); } addAppointmentComment({ appointmentId, type, parentId, content, file, name }) { return this.apiPost('/my/course/appointment/comment/add', { appointmentId, type, parentId, content, file, name }); } editAppointmentComment({ id, content, file, name }) { return this.apiPost('/my/course/appointment/comment/edit', { id, content, file, name }); } delAppointmentComment(id) { return this.apiDel('/my/course/appointment/comment/delete', { id }); } /** * 申请停课 * @param {*} recordId */ suspendCourse(recordId) { return this.apiPost('/my/course/suspend', { recordId }); } /** * 申请恢复课程 * @param {*} recordId */ restoreCourse(recordId) { return this.apiPost('/my/course/restore', { recordId }); } /** * 课程时间表 * @param {*} recordId */ timeCourse(recordId) { return this.apiGet('/my/course/time', { recordId }); } /** * 导出题目 * @param {*} setting */ exportQuestionCollect(setting) { return this.apiPost('/my/export/question/collect', { setting }); } /** * 导出题目 * @param {*} setting */ exportQuestionError(setting) { return this.apiPost('/my/export/question/error', { setting }); } /** * 导出题目笔记 * @param {*}} setting */ exportNoteQuestion(setting) { return this.apiPost('/my/export/note/question', { setting }); } /** * 导出课程笔记 * @param {*} setting */ exportNoteCourse(setting) { return this.apiPost('/my/export/note/course', { setting }); } exportDetail(id) { return this.apiGet('/my/export/detail', { id }); } /** * 关闭导出提示 */ exportTips() { return this.apiPost('/my/export/tips', {}); } textbookTips() { return this.apiPost('/my/textbook/tips', {}); } /** * 关闭评论提示 * @param {*}} recordId */ courseCommentTips(recordId) { return this.apiPost('/my/course/comment/tips', { recordId }); } addSearchHistory(questionNoId) { return this.apiPost('/my/search/history', { questionNoId }); } clearSearchHistory(date) { return this.apiPost('/my/search/history/clear', { date }); } listSearchHistory() { return this.apiGet('/my/search/history/list', {}); } } export const My = new MyStore({ key: 'my' });