更新:增加课程首页分类跳转列表页;优化全站列表分页加载;
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
import { createRequestClient } from '../request'
|
||||
import { SERVICE_MAP } from '../config'
|
||||
import type {
|
||||
ICourseMedicalTreeResponse,
|
||||
ICourseCategoryResponse,
|
||||
IUserLateCourseListResponse,
|
||||
IMarketCourseListResponse
|
||||
IMarketCourseListResponse,
|
||||
ICourseMedicalLabelsResponse
|
||||
} from '@/types/course'
|
||||
import type { ISearchRequest, ISearchResponse } from '@/types/search'
|
||||
|
||||
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
|
||||
|
||||
/**
|
||||
* 课程相关API
|
||||
* 课程分类及分类下课程相关API
|
||||
*/
|
||||
export const courseSubjectClassificationApi = {
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ export const courseSubjectClassificationApi = {
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseMedicalTree() {
|
||||
return client.request<ICourseMedicalTreeResponse>({
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'medical/home/getCourseMedicalTree',
|
||||
method: 'POST',
|
||||
data: {}
|
||||
@@ -33,7 +33,7 @@ export const courseSubjectClassificationApi = {
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseSoulTree() {
|
||||
return client.request<ICourseMedicalTreeResponse>({
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'psyche/home/getPsycheLabels',
|
||||
method: 'POST',
|
||||
data: { id: 0 }
|
||||
@@ -46,10 +46,103 @@ export const courseSubjectClassificationApi = {
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseSociologyTree() {
|
||||
return client.request<ICourseMedicalTreeResponse>({
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'sociology/home/getSociologyLabels',
|
||||
method: 'POST',
|
||||
data: { id: 0 }
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 医学
|
||||
* 获取分类标签列表
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseMedicalLabels(id: number) {
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'medical/home/getMedicalLabels',
|
||||
method: 'POST',
|
||||
data: { id }
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 医学
|
||||
* 获取分类下的列表页子级标签
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseMedicalChildLabels(id: number) {
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'medical/home/getChildCourseMedicalTree',
|
||||
method: 'POST',
|
||||
data: { id }
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 医学
|
||||
* 获取分类下的课程列表
|
||||
* @param data 分类ID、页码、每页数量
|
||||
* @returns 课程列表
|
||||
*/
|
||||
getMedicalCourseList(data: {
|
||||
id: number, // 分类ID
|
||||
page: number, // 页码
|
||||
limit: number // 每页数量
|
||||
}) {
|
||||
return client.request<IMarketCourseListResponse>({
|
||||
url: 'medical/home/getMedicalCourseList',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 心理学
|
||||
* 获取分类下的列表页子级标签
|
||||
* @returns 分类数据
|
||||
*/
|
||||
getCourseSoulChildLabels(id: number) {
|
||||
return client.request<ICourseCategoryResponse>({
|
||||
url: 'psyche/home/getChildCoursePsycheTree',
|
||||
method: 'POST',
|
||||
data: { id }
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 心理学
|
||||
* 获取分类下的课程列表
|
||||
* @param data 分类ID、页码、每页数量
|
||||
* @returns 课程列表
|
||||
*/
|
||||
getSoulCourseList(data: {
|
||||
id: number, // 分类ID
|
||||
page: number, // 页码
|
||||
limit: number // 每页数量
|
||||
}) {
|
||||
return client.request<IMarketCourseListResponse>({
|
||||
url: 'psyche/home/getPsycheCourseList',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 国学
|
||||
* 获取分类下的课程列表
|
||||
* @param data 分类ID、页码、每页数量
|
||||
* @returns 课程列表
|
||||
*/
|
||||
getSociologyCourseList(data: {
|
||||
id: number, // 分类ID
|
||||
page: number, // 页码
|
||||
limit: number // 每页数量
|
||||
}) {
|
||||
return client.request<IMarketCourseListResponse>({
|
||||
url: 'sociology/course/getSociologyCourseList',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user