/*
 * @Author: zjq
 * @description 课件管理
 */
import request from '@/utils/request';

/**
 * @description 新增课件
 * @param {object} data
 */
export const addCourseware = (data: object) => {
    return request({
        url: '/api/v1/Sourcewares/Add',
        method: 'post',
        data,
    });
};
/**
 * @description 编辑课件
 * @param {object} data
 */
export const editCourseware = (data: object) => {
    return request({
        url: '/api/v1/Sourcewares/Update',
        method: 'put',
        data,
    });
};
/**
 * @description 删除课件
 * @param {object} data
 */
export const deleteCourseware = (data: object) => {
    return request({
        url: '/api/v1/Sourcewares/Delete',
        method: 'delete',
        data,
    });
};
/**
 * @description 获取课件列表
 * @param {object} params
 */
export const getCoursewareData = (params?: object) => {
    return request({
        url: '/api/v1/Sourcewares/GetPagedList',
        method: 'post',
        data: params,
    });
};
/**
 * @description 查询课件详情
 * @param {object} Id
 */
export const getCoursewareDetail = (Id: string) => {
    return request({
        url: `/api/v1/Sourcewares/Get?id=${Id}`,
        method: 'get',
    });
};
/**
 * @description 批量下载文件 （文件服务）
 * @param {object}  params
 */
export const fileDownloadBatch = (params: object) => {
    return request({
        url: `/file/downloadfile_batch`,
        method: 'post',
        responseType: 'blob',
        data: params,
        baseURL: import.meta.env.VITE_API_UPLOAD_URL,
    },{
        reduce_data_format:false
    });
};