/** * 授权 API */ import { http } from '../request/main.js'; /** * 获取分类列表 * * @returns {Promise} */ export function getCategoryList(id) { return http.post('/course/getCategoryList', {}, { muteLogin: true }); } /** * 获取课程列表 * * @returns {Promise} */ export function getCourseList(category_id, group, sort, keyword, page, page_size) { return http.post('/course/getCourseList', { category_id, group, sort, keyword, page, page_size }, { muteLogin: true }); } /** * 获取课程详情 * * @returns {Promise} */ export function getCourseDetail(id) { return http.post('/course/getCourseDetail', { id }, { muteLogin: true }); } /** * 获取课程考核 * * @returns {Promise} */ export function getCourseExamine(id) { return http.post('/course/getCourseExamine', { id }, { muteLogin: true }); } /** * 获取内容详情 * * @returns {Promise} */ export function getContentDetail(id) { return http.post('/course/getContentDetail', { id }); } /** * 开始学习 * * @returns {Promise} */ export function startLearn(id) { return http.post('/course/startLearn', { id }); } /** * 同步播放状态 * * @returns {Promise} */ export function syncPlayState(course_id, content_id, current_time, current_offset, play_time, sync_time) { return http.post('/course/syncPlayState', { course_id, content_id, current_time, current_offset, play_time, sync_time }); } /** * 获取收藏列表 * * @returns {Promise} */ export function getLikeList(page, page_size) { return http.post('/course/getLikeList', { page, page_size }); } /** * 收藏操作 * * @returns {Promise} */ export function handleLike(course_id, action) { return http.post('/course/handleLike', { course_id, action }); } /** * 获取我的课程列表 * * @returns {Promise} */ export function getMineCourseList(page, page_size) { return http.post('/course/getMineCourseList', { page, page_size }); } /** * 删除我的课程 * * @returns {Promise} */ export function mineCourseDelete(course_id) { return http.post('/course/mineCourseDelete', { course_id }); } /** * 获取评价列表 * * @returns {Promise} */ export function getEvaluateList(teacher_id, page, page_size) { return http.post('/teacher/getEvaluateList', { teacher_id, page, page_size }, { muteLogin: true }) }