course.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { usePost, stringify, useGet } from "@/.cool";
  2. import type { FileList } from '../types/index'
  3. export interface SubjectCourseResult {
  4. id?: string
  5. subjectId?: string
  6. catalogId?: string
  7. mainTitle?: string
  8. assistantTitle?: string
  9. iconPath?: string
  10. sortNum?: string
  11. remark?: string
  12. updateUserId?: string
  13. updateUserName?: string
  14. createdUserId?: string
  15. createdUserName?: string
  16. createdTime?: string
  17. updateTime?: string
  18. delFlag?: boolean
  19. trialPlay?: boolean
  20. feeType?: number
  21. gameHtmlPath?: string
  22. videoPath?: string
  23. detailItem?: any
  24. practiceList?: any[]
  25. ossIconPath?: string
  26. testItem?: any
  27. diaryItem?: any
  28. courseUserProgress?: any
  29. fileList?: FileList[]
  30. }
  31. // export function getSubjectCoursePage(parameter: any) {
  32. // return useGet<GetPage<any>>(`/subject/course/page`, parameter)
  33. // }
  34. // export function addSubjectCourse(parameter: SubjectCourseResult) {
  35. // return usePost<any>(`/subject/course`, parameter)
  36. // }
  37. // export function updateSubjectCourse(parameter: SubjectCourseResult) {
  38. // return usePut<any>(`/subject/course/${parameter.id}`, parameter)
  39. // }
  40. // export function fetchSubjectCourse(parameter: any) {
  41. // return useGet<SubjectCourseResult>(`/subject/course/${parameter.id}`)
  42. // }
  43. export function fetchSubjectCourseApp(parameter: any) {
  44. return useGet(`/subject/course/app/query/${parameter.id}`) as Promise<SubjectCourseResult>
  45. }
  46. // export function deleteSubjectCourses(parameter: string[]) {
  47. // return useDelete<any>(`/subject/course`, parameter)
  48. // }
  49. // export function exportSubjectCourse(parameter: any) {
  50. // return useGet<any>(`/subject/course/export`, parameter, {
  51. // responseType: 'blob',
  52. // headers: {
  53. // 'Content-Type': 'application/json;charset=UTF-8',
  54. // },
  55. // })
  56. // }
  57. export function updateSubjectProgress(parameter: any) {
  58. return usePost(`/subject/progress/update/progress`, parameter)
  59. }