import { request } from '@umijs/max';


// 分类
export function categoryAdd(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/category/add`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}


export function categoryList(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/category/list`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

export function categoryDelete(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/category/deleteBatchByIds`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

export function roleUpdate(params?: any, options?: { [key: string]: any }) {
    return request(`/api/sys/role/update`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

// 文件
export function filesPage(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/page`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

export function filesAdd(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/add`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

export function filesDelete(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/deleteBatchByIds`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

export function filesMove(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/moveFile`, {
        method: 'POST',
        data:params,
        ...(options || {})
    });
}

// OSS
export function getOssUploadParams(params?: any, options?: { [key: string]: any }) {
    return request(`/api/files/getOssUploadParams`, {
        method: 'GET',
        data:params,
        ...(options || {})
    });
}


