12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import request from "@/util/request.ts";
- /**
- * 获取课程的详情
- * 包括课程的名称,封面,知识点等
- */
- export function getCourseDetail(id:any) {
- return request({
- method: "get",
- url: "/course",
- params: {
- id: id
- }
- });
- }
- /**
- * 新增或保存课程
- *
- */
- export function saveCourse(data:any) {
- if (data.id != null && data.id.length > 0) {
- return request({
- url:"/course",
- method: "put",
- data:data
- });
- } else {
-
- return request({
- url: "/course",
- method: "post",
- data: data
- });
- }
- }
- /*********Start 章节相关************/
- export function saveChapterItem(data:any) {
- if (data.id != null && data.id.length > 0) {
- return request({
- url: "/courseChapter",
- method: "put",
- data: data
- });
- } else {
- return request({
- url: "/courseChapter",
- method: "post",
- data: data
- });
- }
- }
- export function deleteChapterItem(id: any) {
- return request({
- method: "delete",
- url: "/courseChapter",
- params: {
- id: id
- }
- });
- }
- /**
- *
- * @param id
- */
- export function getChapterDetail(id: any) {
- return request({
- method: "get",
- url: "courseChapter",
- params: {
- id: id
- }
- });
- }
- export function getChapterTree(id:any) {
- return request({
- method: "get",
- url: "/courseChapter/tree",
- params: {
- courseId:id
- }
- });
- }
|