mirror of
https://github.com/PlayEdu/backend
synced 2025-06-29 11:22:50 +08:00
课件新增api增加
This commit is contained in:
parent
c4955adb03
commit
1556d8ec03
22
src/api/course-attachment.ts
Normal file
22
src/api/course-attachment.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import client from "./internal/httpClient";
|
||||
|
||||
export function updateCourseAttachment(
|
||||
courseId: number,
|
||||
id: number,
|
||||
chapterId: number,
|
||||
name: string,
|
||||
type: string,
|
||||
rid: number
|
||||
) {
|
||||
return client.put(`/backend/v1/course/${courseId}/attachment/create-batch`, {
|
||||
chapter_id: chapterId,
|
||||
name,
|
||||
type,
|
||||
sort: 0,
|
||||
rid,
|
||||
});
|
||||
}
|
||||
|
||||
export function destroyAttachment(courseId: number, id: number) {
|
||||
return client.destroy(`/backend/v1/course/${courseId}/attachment/${id}`);
|
||||
}
|
@ -35,7 +35,8 @@ export function storeCourse(
|
||||
depIds: number[],
|
||||
categoryIds: number[],
|
||||
chapters: number[],
|
||||
hours: number[]
|
||||
hours: number[],
|
||||
attachments: any[]
|
||||
) {
|
||||
return client.post("/backend/v1/course/create", {
|
||||
title: title,
|
||||
@ -47,6 +48,7 @@ export function storeCourse(
|
||||
category_ids: categoryIds,
|
||||
chapters: chapters,
|
||||
hours: hours,
|
||||
attachments: attachments,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ export * as courseCategory from "./course-category";
|
||||
export * as courseChapter from "./course-chapter";
|
||||
export * as course from "./course";
|
||||
export * as courseHour from "./course-hour";
|
||||
export * as courseAttachment from "./course-attachment";
|
||||
export * as department from "./department";
|
||||
export * as resourceCategory from "./resource-category";
|
||||
export * as resource from "./resource";
|
||||
|
@ -224,7 +224,8 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
||||
dep_ids,
|
||||
values.category_ids,
|
||||
chapters,
|
||||
treeData
|
||||
treeData,
|
||||
[]
|
||||
)
|
||||
.then((res: any) => {
|
||||
message.success("保存成功!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user