import { httpAxios_gym, httpAxios_gyt, httpAxios_klx } from "@/api/ApiInstance"

/** 管乐迷 */

//获取课程列表
export const queryLessonCourseware_gym = (type: string, abortController: AbortController) => {
   return httpAxios_gym.axioseRquest({
      signal: abortController.signal,
      method: "post",
      url: "/api-teacher/lessonCourseware/queryLessonCourseware",
      data: {
         subjectId: type,
         page: 1,
         rows: 9999
      }
   })
}

// 获取课程类型
export const getLessonCoursewareSubjectList_gym = () => {
   return httpAxios_gym.axioseRquest({
      method: "get",
      url: "/api-teacher/lessonCourseware/getLessonCoursewareSubjectList"
   })
}

// 课程详情列表
export const getLessonCoursewareCourseList_gym = (params: {
   id: string
   data: { search?: string; detailFlag?: string }
   abortController: AbortController
}) => {
   return httpAxios_gym.axioseRquest({
      signal: params.abortController.signal,
      method: "get",
      url: `/api-teacher/lessonCourseware/getLessonCoursewareCourseList/${params.id}`,
      params: params.data
   })
}

// 课程详情 播放用
export const getLessonCourseDetail_gym = (id: string) => {
   return httpAxios_gym.axioseRquest({
      method: "get",
      url: "/api-teacher/lessonCourseware/getLessonCourseDetail/" + id
   })
}

/**
 * 管乐团
 */

// 课程列表
export const getMyCourseware_gyt = () => {
   return httpAxios_gyt.axioseRquest({
      method: "post",
      url: "/api-teacher/courseSchedule/myCourseware"
   })
}

// 课程详情列表
export const getMyCoursewareDetail_gyt = (params: {
   id: string
   data: { search?: string; detailFlag?: string }
   abortController: AbortController
}) => {
   return httpAxios_gyt.axioseRquest({
      signal: params.abortController.signal,
      method: "post",
      url: `/api-teacher/courseSchedule/myCoursewareDetail/${params.id}`,
      params: params.data
   })
}

// 课程详情 播放用
export const getLessonCoursewareDetail_gyt = (id: string) => {
   return httpAxios_gyt.axioseRquest({
      method: "get",
      url: "/api-teacher/lessonCoursewareDetail/detail/" + id
   })
}

/**
 * 酷乐秀
 */

// 专辑列表
export const getuyAlbumInfo_klx = (data?: any) => {
   return httpAxios_klx.axioseRquest({
      method: "get",
      url: "/api-teacher/tenantGroupAlbum/buyAlbumInfo",
      params: data
   })
}

// 乐器列表
export const queryPageSubject_klx = () => {
   return httpAxios_klx.axioseRquest({
      method: "get",
      url: "/api-tenant/open/subject/queryPage?page=1&rows=9999&queryType=list"
   })
}

//获取课程列表
export const queryLessonCourseware_klx = (type: string, albumId: string, abortController: AbortController) => {
   return httpAxios_klx.axioseRquest({
      signal: abortController.signal,
      method: "post",
      url: "/api-teacher/tenantAlbumMusic/page",
      data: {
         subjectType: "COURSEWARE",
         albumId: albumId,
         page: 1,
         rows: 9999,
         subjectId: type
      }
   })
}

// 课程详情列表
export const getLessonCoursewareCourseList_klx = (params: {
   id: string
   data: { search?: string; detailFlag?: string }
   abortController: AbortController
}) => {
   return httpAxios_klx.axioseRquest({
      signal: params.abortController.signal,
      method: "get",
      url: `/api-teacher/tenantAlbumMusic/getLessonCoursewareCourseList/${params.id}`,
      params: params.data
   })
}

// 课程详情 播放用
export const getLessonCourseDetail_klx = (id: string) => {
   return httpAxios_klx.axioseRquest({
      method: "get",
      url: "/api-teacher/tenantAlbumMusic/getLessonCourseDetail/" + id
   })
}
