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

export default {
    //创建角色
    CreateRole(parms: RolelTypes.RoleType) {
        return request('/api/authorize/AddRole', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },

    //删除角色
    DeleteRole(id: string) {
        return request(`/api/authorize/RemoveRole?input=${id}`, {
            method: 'GET'
        });
    },

    //修改角色
    ModifyRole(parms: RolelTypes.RoleType) {
        return request('/api/authorize/EditRole', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },


    //获取角色列表
    GetRoleList() {
        return request('/api/authorize/GetRoleList', {
            method: 'GET',
        });
    },

    /**
     * 角色分页查询
     * @param parms 
     * @returns 
     */
    GetRolePagedList(parms: RolelTypes.RolePageParams) {
        return request('/api/authorize/QueryRole', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    }
}