index.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import request from '@/config/axios'
  2. // 课程 VO
  3. export interface CourseVO {
  4. id: number // 课程d
  5. courseName: string // 课程名称
  6. courseContentType: "all", // 课程内容类型
  7. courseImagePath: undefined, // 课程图片路径
  8. courseVideoPath: undefined, // 课程视频路径
  9. courseMusicPath: undefined, // 课程音乐路径
  10. courseFilePath: undefined, // 课程文件路径
  11. courseContent: undefined, // 课程内容
  12. courseAuthor: string // 课程作者
  13. courseTeacher: string // 课程老师
  14. courseSize: number // 课程大小
  15. courseTime: number // 课程时长
  16. courseIsInspect: false // 课程是否有检查
  17. courseType: number // 课程类型
  18. courseTypeName: string // 课程类型
  19. courseLabel: string // 课程标签
  20. courseOrder: number // 课程排序
  21. courseStatus: "0" // 课程状态
  22. tenantId: Number // 租户id
  23. }
  24. // 课程 API
  25. export const CourseApi = {
  26. // 查询课程分页
  27. getCoursePage: async (params: any) => {
  28. return await request.get({ url: `/bjdx/course/page`, params })
  29. },
  30. // 查询课程详情
  31. getCourse: async (id: number) => {
  32. return await request.get({ url: `/bjdx/course/get?id=` + id })
  33. },
  34. // 新增课程
  35. createCourse: async (data: CourseVO) => {
  36. return await request.post({ url: `/bjdx/course/create`, data })
  37. },
  38. // 修改课程
  39. updateCourse: async (data: CourseVO) => {
  40. return await request.put({ url: `/bjdx/course/update`, data })
  41. },
  42. // 删除课程
  43. deleteCourse: async (id: number) => {
  44. return await request.delete({ url: `/bjdx/course/delete?id=` + id })
  45. },
  46. // 导出课程 Excel
  47. exportCourse: async (params) => {
  48. return await request.download({ url: `/bjdx/course/export-excel`, params })
  49. },
  50. // 根据类型id获取课程列表
  51. getCourseByTypeId: async (typeId: String) => {
  52. return await request.get({ url: `/bjdxWeb/course/getCourseByTypeId?typeId=` + typeId })
  53. },
  54. // 取课程列表
  55. getCourseTypeTree: async () => {
  56. return await request.get({ url: `/bjdxWeb/course/getCourseTypeTree`})
  57. }
  58. }