mirror of
https://github.com/PlayEdu/backend
synced 2025-06-07 05:34:05 +08:00
课时api
This commit is contained in:
parent
1a3ca7ad33
commit
f77d354953
52
src/api/course-hour.ts
Normal file
52
src/api/course-hour.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import client from "./internal/httpClient";
|
||||
|
||||
export function courseHourList(courseId: number) {
|
||||
return client.get(`/backend/v1/course/${courseId}/course-hour/index`, {});
|
||||
}
|
||||
|
||||
export function createCourseHour(courseId: number) {
|
||||
return client.get(`/backend/v1/course/${courseId}/course-hour/create`, {});
|
||||
}
|
||||
|
||||
export function storeCourseHour(
|
||||
courseId: number,
|
||||
chapterId: number,
|
||||
title: string,
|
||||
type: string,
|
||||
druation: number,
|
||||
publishedAt: string
|
||||
) {
|
||||
return client.post(`/backend/v1/course/${courseId}/course-hour/create`, {
|
||||
chapter_id: chapterId,
|
||||
title,
|
||||
type,
|
||||
druation,
|
||||
published_at: publishedAt,
|
||||
});
|
||||
}
|
||||
|
||||
export function courseHour(courseId: number, id: number) {
|
||||
return client.get(`/backend/v1/course/${courseId}/course-hour/${id}`, {});
|
||||
}
|
||||
|
||||
export function updateCourseHour(
|
||||
courseId: number,
|
||||
id: number,
|
||||
chapterId: number,
|
||||
title: string,
|
||||
type: string,
|
||||
druation: number,
|
||||
publishedAt: string
|
||||
) {
|
||||
return client.post(`/backend/v1/course/${courseId}/course-hour/${id}`, {
|
||||
chapter_id: chapterId,
|
||||
title,
|
||||
type,
|
||||
druation,
|
||||
published_at: publishedAt,
|
||||
});
|
||||
}
|
||||
|
||||
export function destroyCourseHour(courseId: number, id: number) {
|
||||
return client.destroy(`/backend/v1/course/${courseId}/course-hour/${id}`);
|
||||
}
|
@ -24,6 +24,8 @@ export function createCourse() {
|
||||
return client.get("/backend/v1/course/create", {});
|
||||
}
|
||||
|
||||
// depIds => 部门id数组,请用英文逗号连接
|
||||
// categoryIds => 所属分类数组,请用英文逗号连接
|
||||
export function storeCourse(
|
||||
title: string,
|
||||
thumb: string,
|
||||
|
Loading…
x
Reference in New Issue
Block a user