61 lines
1.2 KiB
TypeScript
61 lines
1.2 KiB
TypeScript
// api/modules/video.ts
|
|
import { createRequestClient } from '../request'
|
|
import { SERVICE_MAP } from '../config'
|
|
import type { IApiResponse } from '../types'
|
|
import type { IVideoCheckResponse } from '@/types/video'
|
|
|
|
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
|
|
|
|
/**
|
|
* 视频相关API
|
|
*/
|
|
export const videoApi = {
|
|
/**
|
|
* 获取视频播放信息
|
|
* 接口: sociology/course/checkVideo
|
|
* 方法: POST
|
|
*/
|
|
checkVideo(data: {
|
|
id: number
|
|
}) {
|
|
return client.request<IVideoCheckResponse>({
|
|
url: 'sociology/course/checkVideo',
|
|
method: 'POST',
|
|
data
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 保存播放进度
|
|
* 接口: sociology/course/saveCoursePosition
|
|
* 方法: POST
|
|
*/
|
|
saveCoursePosition(data: {
|
|
videoId: number
|
|
position: number
|
|
}) {
|
|
return client.request<IApiResponse>({
|
|
url: 'sociology/course/saveCoursePosition',
|
|
method: 'POST',
|
|
data
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 报告错误视频
|
|
* 接口: medical/course/addErrorCourse
|
|
* 方法: POST
|
|
*/
|
|
addErrorCourse(data: {
|
|
chapterId: number
|
|
videoId: number
|
|
sort: number
|
|
}) {
|
|
return client.request<IApiResponse>({
|
|
url: 'medical/course/addErrorCourse',
|
|
method: 'POST',
|
|
data
|
|
})
|
|
}
|
|
}
|