import Http from "../utils/http"; class Api { //合并请求 static async promiseAllSettled(array) { let res = await Promise.allSettled(array) res = res.map(item => { return item.status == "fulfilled" ? item.value : null; }) return res; } static async promiseAll(array) { let res = await Promise.all(array) return res; } //登录 static login(phone, verify, isLoading) { return Http.request({ url: `/auth/app/phoneLogin?phone=${phone}&verify=${verify}`, method: 'POST', opt: {isLoading} }) } static getWXOpenId(code, isLoading){ return Http.request({ url: `/auth/app/getUnionId?code=${code}`, method: 'POST', opt: {isLoading} }) } //微信登录 static async loginByWX(code, isLoading) { return Http.request({ url: `/auth/app/wxLogin?code=${code}`, method: 'POST', opt: {isLoading} }) } //绑定手机号+微信 static binding(code) { return Http.request({ url: `/auth/app/binding?code=${code}`, method: 'POST', }) } //登出 static appLogout() { return Http.request({ url: '/auth/app/logout', method: 'DELETE', }) } //发送短信验证码 static sendCode(phone, isLoading) { return Http.request({ url: `/auth/app/sendVerify?phone=${phone}`, method: 'POST', opt: {isLoading} }) } //上传文件获取的密钥 static getCosInfo() { return Http.request({ url: '/video/upload/getCosInfo', method: 'GET', }) } //获取实时音视频的签名 static getSig(data) { return Http.request({ url: '/video/app/sign/genUserSig', method: 'GET', data }) } // 注册 static register(data, isLoading) { return Http.request({ url: `/auth/app/register`, method: 'POST', data, opt: {isLoading} }) } //首页 static getIndex(isLoading) { return Http.request({ url: '/education/app/home/homeIndex/carouselList', method: 'GET', opt: {isLoading} }) } //获取学员通告列表 0未读 1已读 static getStudentNoticeList(data) { return Http.request({ url: '/education/app/studentNotice/list', method: 'GET', data }) } //确认通知为已读 static changeNoticeStatus(data, isLoading) { return Http.request({ url: '/education/app/studentNotice/changeStatus', method: 'GET', data, opt: {isLoading} }) } //获取班级 分类 static getClassList(data) { return Http.request({ url: '/education/app/home/homeIndex/teamList', method: 'GET', data }) } //获取往期培训 static getMyHistoryClass(pathV, data) { return Http.request({ url: `/education/app/team/teamSate/${pathV}`, method: 'GET', data }) } //获取精品课程 分类 static getCourseMngDict(isLoading) { return Http.request({ url: '/education/app/home/homeIndex/getDictChild', method: 'GET', opt: {isLoading} }) } //获取精品课程 列表 static getCourseMngList(data) { return Http.request({ url: '/education/app/home/homeIndex/courseMngList', method: 'GET', data }) } //获取教材阅读 分类 static getTextBookDict(isLoading) { return Http.request({ url: '/resource/app/home/textbookLibrary/selectClassifyList', method: 'POST', opt: {isLoading} }) } //获取教材阅读 列表 static getTextBookList(id, data) { return Http.request({ url: `/resource/app/home/textbookLibrary/selectTextbookLibraryClassifyList?textbookClassify=${id}`, method: 'POST', data }) } //获取教材详细信息 static getBookDetail(pathV, isLoading) { return Http.request({ url: `/resource/app/home/textbookLibrary/${pathV}`, method: 'GET', opt: {isLoading} }) } //获取学院简介 static getCollegeList(isLoading) { return Http.request({ url: '/education/app/home/homeIndex/collegeList', method: 'GET', opt: {isLoading} }) } //获取指定分类下的新闻列表 static getNewsList(data) { return Http.request({ url: '/education/app/home/homeIndex/articleList', method: 'GET', data }) } //获取视频详细信息 static getVideoDetail(pathV, isLoading) { return Http.request({ url: `/education/app/home/homeIndex/${pathV}`, method: 'GET', opt: {isLoading} }) } //获取当前用户 正在直播的课 static getUserLiveId(isLoading) { return Http.request({ url: '/education/app/schedulePerformance/selectSchedulePerformanceMessage', method: 'GET', opt: {isLoading} }) } //查询课程信息 static getCourseInfo(scheduleId, isLoading = true){ return Http.request({ url: '/education/app/schedulePerformance/noAuth/selectSchedulePerformance', method: 'GET', data: { scheduleId }, opt: {isLoading} }) } //获取当前正在进行的培训 static getUserProjects() { return Http.request({ url: '/education/app/team/selectRunningByUser', method: 'GET', }) } //获取培训详情 static getProjectsWithTeam(pathV) { return Http.request({ url: `/education/app/team/userTeamInfo/${pathV}`, method: 'GET', }) } // 提交学员登记表 static submitStudentForm(data) { return Http.request({ url: '/education/app/student/checkIn', method: 'POST', data }) } //学员报到 static report(data) { return Http.request({ url: '/education/app/student/report', method: 'GET', data }) } //获取上传文件目录 static getUploadFile(data) { return Http.request({ url: '/education/app/studentUploadFile/getChildren', method: 'GET', data, }) } //删除文件 static deleteFile(pathV) { return Http.request({ url: `/education/app/studentUploadFile/${pathV}`, method: 'DELETE', }) } //上传文件 static uploadFile(data) { return Http.request({ url: '/education/app/studentUploadFile/addFile', method: 'POST', data }) } //获取班级群 static getTeam(pathV) { return Http.request({ url: `/education/app/team/infos/${pathV}`, method: 'GET', }) } // 判断是否可以参与期末考试 static checkFinalExam(data, errorHandler) { return Http.request({ url: '/education/app/courseSchedule/isAllFinish', method: 'GET', data }, errorHandler) } //获取结业证样式 static getTemplate(data) { return Http.request({ url: '/education/app/template/getInfo', method: 'GET', data }) } //获取结业证编号 static getStudentNum(pathV) { return Http.request({ url: `/education/app/student/${pathV}`, method: 'GET' }) } //生成结业证编号 static produceGradu(id, teamId, isOnline, isLoading, errorHandler) { return Http.request({ url: `/education/app/student/produceGradu?id=${id}&teamId=${teamId}&isOnline=${isOnline}`, method: 'POST', opt: {isLoading} }, errorHandler) } //获取班级学员列表 static getStudentList(data) { return Http.request({ url: '/education/app/student/list', method: 'GET', data }) } static getStudentAvatorList(data){ return Http.request({ url: '/education/app/student/listFive', method: 'GET', data }); } // 住宿安排 static hotelArrange(data) { return Http.request({ url: '/education/app/hotelArrange/queryArrangeRoom', method: 'GET', data }) } //获取班级动态 static getTeamInteraction(data) { return Http.request({ url: '/community/app/teamInteraction/list', method: 'GET', data }) } //发布班级动态 static publishTeamInteraction(data, isLoading) { return Http.request({ url: '/community/app/teamInteraction/add', method: 'POST', data, opt: {isLoading} }) } // 获取此条动态的评论列表 static getinteractionCommentList(data) { return Http.request({ url: '/community/app/interactionComment/list', method: 'GET', data }) } // 发表评论 static addInteractionComment(data, isLoading) { return Http.request({ url: '/community/app/interactionComment/add', method: 'POST', data, opy: {isLoading} }) } //获取课程计划 static getCourseSchedule(data, isLoading) { return Http.request({ url: '/education/app/courseSchedule/list', method: 'GET', data, opt: {isLoading} }) } //获取课程详情 static getCourseDetail(pathV, eId) { return Http.request({ url: `/education/app/courseSchedule/${pathV}/${eId}`, method: 'GET', }) } //游客获取课程详情 TODO 不需要了。。。看看直播页面需不需要标题 static getGuestCourseDetail(pathV) { return Http.request({ url: `/education/app/courseSchedule/getInfo/${pathV}`, method: 'GET', }) } //获取录播信息 static getRecordedLesson(data) { return Http.request({ url: '/education/app/recordedLesson/selectRecordedLessonByStuIdScheduleId', method: 'GET', data }) } //获取人脸核身结果 static getFaceIdentifyResult(verifyResult){ return Http.request({ url: '/education/app/faceCheck/getCode', method: 'GET', data: { verifyResult } }) } //签到 static checkIn(scheduleId, studentId, wifiName) { return Http.request({ url: `/education/app/signIn/insertStudentSign?scheduleId=${scheduleId}&studentId=${studentId}&wifiName=${wifiName}`, method: 'POST', }) } // 提交录播课学习进度 static changeVideoProgress(data, isLoading = true) { return Http.request({ url: '/education/app/recordedLesson/updateRecordedLessonById', method: 'GET', data, opt: {isLoading} }) } //老师 static getTeacher(pathV, isLoading) { return Http.request({ url: `/resource/app/teacher/${pathV}`, method: 'GET', opt: {isLoading} }) } //上报连麦成功 static uploadLinkOk(data) { return Http.request({ url: '/education/integralDetails/integralRuleFour', method: 'GET', data },()=>{}) } //获取学员信息 static getUserInfo() { return Http.request({ url: '/resource/app/student/getInfo', method: 'GET', }) } //获取班级-学员信息 static getUserInfoByTeam(data) { return Http.request({ url: '/resource/app/student/selectStudentByIdAndTeamId', method: 'GET', data }) } //修改用户信息 static changeUserInfo(data) { return Http.request({ url: '/resource/app/student/update', method: 'GET', data }) } // 修改手机号 static updatePhone(data, isLoading) { return Http.request({ url: '/resource/app/student/updatePhone', method: 'GET', data, opt: {isLoading} }) } //获取当前学员兑换的积分课 static getScoreList(data) { return Http.request({ url: '/resource/app/integralCrouse/selectChangeCourseList', method: 'GET', data }) } //获取当前学员未兑换的积分课 static getNoScoreList(data) { return Http.request({ url: '/resource/app/integralCrouse/selectNoChangeCourseList', method: 'GET', data }) } //获取积分课 static getScore(pathV, isLoading) { return Http.request({ url: `/resource/app/integralCrouse/${pathV}`, method: 'GET', opt: {isLoading} }) } //获取积分信息 static getScoreInfo(isLoading) { return Http.request({ url: '/education/app/integralDetails/selectItemSurplusValueByIdCard', method: 'GET', opt: {isLoading} }) } //获取积分明细 static getScoreDetail(data) { return Http.request({ url: '/education/app/integralDetails/selectMiniIntegralDetailsByIntegralType', method: 'GET', data }) } //兑换积分 static useScore(data, isLoading) { return Http.request({ url: '/education/app/integralDetails/insertIntegralCourseByEducationStuId', method: 'GET', data, opt: {isLoading} }) } //获取我的考试列表 static getPaperList(data) { return Http.request({ url: '/resource/app/paper/selStuPaperList', method: 'GET', data }) } //获取考试试卷详情 static getPaper(pathV, isLoading) { return Http.request({ url: `/resource/app/paper/${pathV}`, method: 'GET', opt: {isLoading} }) } //获取考试结果 static getPaperResult(pathV, pathV2, isLoading) { return Http.request({ url: `/resource/app/paper/echopaper/${pathV}/${pathV2}`, method: 'GET', opt: {isLoading} }) } //获取问卷结果 static getQuestionResult(data, isLoading) { return Http.request({ url: `/education/app/answerSheet/getYourAnswer`, method: 'GET', data, opt: {isLoading} }) } //提交答案 static putPaper(data, isLoading) { return Http.request({ url: '/education/app/answerSheet/add', method: 'POST', data, opt: {isLoading} }) } //获取我的问卷列表 static getQuestionList(data) { return Http.request({ url: '/resource/app/questionnaire/stuQuestionnairelist', method: 'GET', data }) } //获取问卷详情 static getQuestion(pathV, isLoading) { return Http.request({ url: `/resource/app/questionnaire/${pathV}`, method: 'GET', opt: {isLoading} }) } //提交问卷 static putQuestion(data, isLoading) { return Http.request({ url: '/education/app/questionnaireSheet/add', method: 'POST', data, opt: {isLoading} }) } // 获取推荐项目 // 0 未报名 1 已报名 static getRecommend(data) { return Http.request({ url: `/education/app/item/selSignedUpRecommendItem/${data.type}`, method: 'GET', data }) } // 获取推荐项目详情 static getRecommendInfo(id, isLoading) { return Http.request({ url: `/education/app/item/selSignedUpRecommendItemTeamInfo/${id}`, method: 'GET', opt: {isLoading} }) } // 推荐项目报名 static signUp(data, isLoading) { return Http.request({ url: '/education/app/student/signUp', method: 'POST', data, opt: {isLoading} }) } //获取我的消息 static getMsgList(data) { return Http.request({ url: '/management/app/messageLog/list', method: 'GET', data }) } //获取app信息 static getHelpInfo(pathV, isLoading) { return Http.request({ url: `/education/app/home/homeIndex/appInfo/${pathV}`, method: 'GET', opt: {isLoading} }) } //获取社区互动首页信息 static getTrainIndex(isLoading) { return Http.request({ url: '/community/app/train/manage/queryTrainInfo', method: 'GET', opt: {isLoading} }) } // 获取消息动态 static getMyMessage(data) { return Http.request({ url: '/community/app/train/detail/queryAllList', method: 'GET', data }) } //获取我的发布 static getTrainList(data) { return Http.request({ url: '/community/app/train/manage/list', method: 'GET', data }) } // 获取我的发布每一条详情 static getTrainListDetail(data, isLoading) { return Http.request({ url: '/community/app/train/manage/queryInfo', method: 'GET', data, opt: {isLoading} }) } // 获取我的评论 static getMyComment(data) { return Http.request({ url: '/community/app/train/detail/list', method: 'GET', data }) } // 发布评论 static ReleaseComment(data, isLoading) { return Http.request({ url: '/community/app/train/detail', method: 'POST', data, opt: {isLoading} }) } //获取培训方向,培训形式,课程类型,典型分类,注册按钮显示状态数据 sys_train_direct、sys_train_form、sys_kc_type、sys_example_type,wifi_config,sys_register_status static getPulishDict(pathV, isLoading) { return Http.request({ url: `/system/app/home/dict/data/type/${pathV}`, method: 'GET', opt: {isLoading} }) } // 发布培训需求 static ReleaseNeeds(data, isLoading) { return Http.request({ url: '/community/app/train/manage', method: 'POST', data, opt: {isLoading} }) } // 发布热点难点 static ReleaseHot(data, isLoading) { return Http.request({ url: '/community/app/focusIssues/add', method: 'POST', data, opt: {isLoading} }) } // 发布典型案例 static ReleaseExamples(data, isLoading) { return Http.request({ url: '/community/app/example', method: 'POST', data, opt: {isLoading} }) } // 查询四级行政区 static getRegionList(data) { return Http.request({ url: '/system/app/home/region/list', method: 'GET', data }) } // 查询单位 static getUnitList(data) { return Http.request({ url: '/system/app/home/unit/list', method: 'GET', data }) } // 根据code查上级行政id 和 单位id static getRegionByCode(data) { return Http.request({ url: '/system/app/home/region/infos', method: 'GET', data }); } // 获取学员手册资料 static getBook(data, isLoading) { return Http.request({ url: '/education/app/manual/list', method: 'GET', data, opt: {isLoading} }) } // 通过索引获取学员手册 static getStudentBookByIndex(index) { return Http.request({ url: `/education/app/manualConfig/infos/${index}`, method: 'GET' }); } // 学员手册日程安排 static studentBookSchedule(data) { return Http.request({ url: '/education/app/classScheduleCard/list', method: 'GET', data }); } // 学员手册座位图 static studentBookSeat(params) { return Http.request({ url: `/education/app/courseSchedule/infos/${params}`, method: 'GET' }); } // 学员手册 学员名单 static studentBookLists(data) { return Http.request({ url: '/education/app/student/studentNameList', method: 'GET', data }); } // 学员手册 项目组名单 static studentBookGroups(id) { return Http.request({ url: `/education/app/team/infos/${id}`, method: 'GET' }); } // 学员手册 教师简介 static studentBookTeacher(url) { return Http.request({ url: `/resource/app/teacher/queryTeacherInfos/${url}`, method: 'GET' }); } //学员手册 基地介绍 static studentBaseLibrary(url) { return Http.request({ url: `/resource/manage/app/library/queryBaseLibraryDesc/${url}`, method: 'GET' }) } //获取课程是否开启 static getCourseOpenStatus(scheduleId, errorHandler) { return Http.request({ url: `/education/app/courseSchedule/getTimer`, method: 'GET', data: { scheduleId } }, errorHandler); } //获取积分规则 static getRule(){ return Http.request({ url: '/education/app/integralRule/list', method: 'GET' }) } static getTeamTeacherPhone(data){ return Http.request({ url: '/education/app/team/getTeamByDirector', method: 'GET', data }); } // static insertRedisGuest({name, id}, isLoading = true){ // return Http.request({ // url: `/education/app/home/homeIndex/insertSelectRedisGuest?nickName=${name}&openId=${id}`, // method: 'GET', // opt: {isLoading} // // data // }); // } // static queryGuestName(openId, isLoading = true) { // return Http.request({ // url: `/education/app/home/homeIndex/insertSelectRedisGuest?openId=${openId}`, // method: 'GET', // opt: {isLoading} // // data // }); // } } export default Api