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

export interface SubjectCatalogResult {
    id?: string
    subjectId?: string
    name?: string
    iconPath?: string
    sortNum?: string
    courseStartNum?: string
    remark?: string
    updateUserId?: string
    updateUserName?: string
    createdUserId?: string
    createdUserName?: string
    createdTime?: string
    updateTime?: string
    ossIconPath?: string
    fileList?: FileList[]
    courseList?: SubjectCourseResult[]
    payFlag?: boolean
    trialPlay?: boolean
    courseNum?: number
}

// export function getSubjectCatalogPage(parameter: any) {
//     return useGet<GetPage<any>>(`/subject/catalog/page`, parameter)
// }
// export function addSubjectCatalog(parameter: SubjectCatalogResult) {
//     return usePost<any>(`/subject/catalog`, parameter)
// }
// export function updateSubjectCatalog(parameter: SubjectCatalogResult) {
//     return usePut<any>(`/subject/catalog/${parameter.id}`, parameter)
// }
export function fetchSubjectCatalog(parameter: any) {
    return useGet(`/subject/catalog/${parameter.id}`) as Promise<SubjectCatalogResult>
}
export function querySubjectCatalog(parameter: any) {
    return useGet(`/subject/catalog`, parameter) as Promise<SubjectCatalogResult[]>
}
export function querySubjectCatalogNoLogin(parameter: any) {
    return useGet(`/subject/catalog/no/login`, parameter) as Promise<SubjectCatalogResult[]>
}
// export function deleteSubjectCatalogs(parameter: string[]) {
//     return useDelete<any>(`/subject/catalog`, parameter)
// }

// export function exportSubjectCatalog(parameter: any) {
//     return useGet<any>(`/subject/catalog/export`, parameter, {
//         responseType: 'blob',
//         headers: {
//             'Content-Type': 'application/json;charset=UTF-8',
//         },
//     })
// }
