import request from '/@/utils/request';
import type { AxiosPromise } from 'axios';
import type { IClientVsResource, IClientVsResourceReponse } from './types/index.type';
import type { ICommonListParams } from '../common.type';


/**
 * 添加客户权限api
 * @param data 
 * @returns 
 */
export function addClientVsResourceApi(data: IClientVsResource) {
    return request({
        url: '/client/vs/resource/add',
        method: 'post',
        data
    })
}

/**
 * 修改客户权限api
 * @param data 
 * @returns 
 */
export function updateClientVsResourceApi(data: IClientVsResource) {
    return request({
        url: '/client/vs/resource/update',
        method: 'post',
        data
    })
}

/**
 * 删除客户权限api
 * @param data 
 * @returns 
 */
export function delClientVsResourceApi(id: number) {
    return request({
        url: '/client/vs/resource/delete',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        params: { id }
    })
}

/**
 * 获取客户权限列表api
 * @param params 
 * @returns 
 */
export function getClientVsResourceListApi(params: ICommonListParams) :AxiosPromise<IClientVsResourceReponse> {
    return request({
        url: '/client/vs/resource/list',
        method: 'post',
        params
    })
}