import { usePost, stringify, useGet } from "@/.cool";
import type { FileList } from '../types/index'


export interface SubjectCourseResult {
    id?: string
    subjectId?: string
    catalogId?: string
    mainTitle?: string
    assistantTitle?: string
    iconPath?: string
    sortNum?: string
    remark?: string
    updateUserId?: string
    updateUserName?: string
    createdUserId?: string
    createdUserName?: string
    createdTime?: string
    updateTime?: string
    delFlag?: boolean
    trialPlay?: boolean
    feeType?: number
    gameHtmlPath?: string
    videoPath?: string
    detailItem?: any
    practiceList?: any[]
    testItem?: any
    diaryItem?: any
    courseUserProgress?: any
    fileList?: FileList[]
}

// export function getSubjectCoursePage(parameter: any) {
//     return useGet<GetPage<any>>(`/subject/course/page`, parameter)
// }
// export function addSubjectCourse(parameter: SubjectCourseResult) {
//     return usePost<any>(`/subject/course`, parameter)
// }
// export function updateSubjectCourse(parameter: SubjectCourseResult) {
//     return usePut<any>(`/subject/course/${parameter.id}`, parameter)
// }
// export function fetchSubjectCourse(parameter: any) {
//     return useGet<SubjectCourseResult>(`/subject/course/${parameter.id}`)
// }
export function fetchSubjectCourseApp(parameter: any) {
    return useGet(`/subject/course/app/query/${parameter.id}`) as Promise<SubjectCourseResult>
}
// export function deleteSubjectCourses(parameter: string[]) {
//     return useDelete<any>(`/subject/course`, parameter)
// }

// export function exportSubjectCourse(parameter: any) {
//     return useGet<any>(`/subject/course/export`, parameter, {
//         responseType: 'blob',
//         headers: {
//             'Content-Type': 'application/json;charset=UTF-8',
//         },
//     })
// }
export function updateSubjectProgress(parameter: any) {
    return usePost(`/subject/progress/update/progress`, parameter)
}