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/${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,
            },
        });
    }
}