123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587 |
- 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.apiPost('/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, structIds, latest, year, page, size, startTime, endTime, order }) {
- return this.apiGet('/my/error/list', { keyword, module, questionTypes, 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, qxContent, officialContent, associationContent, qaContent }) {
- return this.apiPut('/my/note/question', { questionNoId, content, 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, structIds, latest, year, page, size, startTime, endTime, order }) {
- return this.apiGet('/my/note/question/list', { keyword, module, questionTypes, 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' });
|