mirror of
https://github.com/PlayEdu/backend
synced 2025-06-29 19:12:46 +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[],
|
depIds: number[],
|
||||||
categoryIds: number[],
|
categoryIds: number[],
|
||||||
chapters: number[],
|
chapters: number[],
|
||||||
hours: number[]
|
hours: number[],
|
||||||
|
attachments: any[]
|
||||||
) {
|
) {
|
||||||
return client.post("/backend/v1/course/create", {
|
return client.post("/backend/v1/course/create", {
|
||||||
title: title,
|
title: title,
|
||||||
@ -47,6 +48,7 @@ export function storeCourse(
|
|||||||
category_ids: categoryIds,
|
category_ids: categoryIds,
|
||||||
chapters: chapters,
|
chapters: chapters,
|
||||||
hours: hours,
|
hours: hours,
|
||||||
|
attachments: attachments,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ export * as courseCategory from "./course-category";
|
|||||||
export * as courseChapter from "./course-chapter";
|
export * as courseChapter from "./course-chapter";
|
||||||
export * as course from "./course";
|
export * as course from "./course";
|
||||||
export * as courseHour from "./course-hour";
|
export * as courseHour from "./course-hour";
|
||||||
|
export * as courseAttachment from "./course-attachment";
|
||||||
export * as department from "./department";
|
export * as department from "./department";
|
||||||
export * as resourceCategory from "./resource-category";
|
export * as resourceCategory from "./resource-category";
|
||||||
export * as resource from "./resource";
|
export * as resource from "./resource";
|
||||||
|
@ -224,7 +224,8 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
|||||||
dep_ids,
|
dep_ids,
|
||||||
values.category_ids,
|
values.category_ids,
|
||||||
chapters,
|
chapters,
|
||||||
treeData
|
treeData,
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user