课时api

This commit is contained in:
none 2023-03-03 09:45:12 +08:00
parent 1a3ca7ad33
commit f77d354953
2 changed files with 54 additions and 0 deletions

52
src/api/course-hour.ts Normal file
View 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}`);
}

View File

@ -24,6 +24,8 @@ export function createCourse() {
return client.get("/backend/v1/course/create", {});
}
// depIds => 部门id数组请用英文逗号连接
// categoryIds => 所属分类数组,请用英文逗号连接
export function storeCourse(
title: string,
thumb: string,