56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
// api/modules/course.ts
|
|
import { createRequestClient } from '../request'
|
|
import { SERVICE_MAP } from '../config'
|
|
import type {
|
|
ICourseMedicalTreeResponse,
|
|
IUserLateCourseListResponse,
|
|
IMarketCourseListResponse
|
|
} from '@/types/course'
|
|
import type { ISearchRequest, ISearchResponse } from '@/types/search'
|
|
|
|
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
|
|
|
|
/**
|
|
* 课程相关API
|
|
*/
|
|
export const courseSubjectClassificationApi = {
|
|
/**
|
|
* 医学
|
|
* 获取课程分类树
|
|
* @returns 分类数据
|
|
*/
|
|
getCourseMedicalTree() {
|
|
return client.request<ICourseMedicalTreeResponse>({
|
|
url: 'medical/home/getCourseMedicalTree',
|
|
method: 'POST',
|
|
data: {}
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 心理学
|
|
* 获取课程分类树
|
|
* @returns 分类数据
|
|
*/
|
|
getCourseSoulTree() {
|
|
return client.request<ICourseMedicalTreeResponse>({
|
|
url: 'psyche/home/getPsycheLabels',
|
|
method: 'POST',
|
|
data: { id: 0 }
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 国学
|
|
* 获取课程分类树
|
|
* @returns 分类数据
|
|
*/
|
|
getCourseSociologyTree() {
|
|
return client.request<ICourseMedicalTreeResponse>({
|
|
url: 'sociology/home/getSociologyLabels',
|
|
method: 'POST',
|
|
data: { id: 0 }
|
|
})
|
|
}
|
|
}
|