import { FacUserRoleModel } from '@/types'
import request from '@/until/request'

/**
 * 获取内部用户角色列表
 */
const QueryRoleList = () =>
    request({
        url: '/FacUserRoleAction/list',
        method: 'get'
    })

/**
* 新增内部用户角色
* @param data FacUserRole
*/
const AddFacUserRole = (data: FacUserRoleModel) =>
    request({
        url: '/FacUserRoleAction/saveFacUserRole',
        method: 'post',
        data: data
    })

/**
* 编辑内部用户角色
* @param data FacUserRole
*/
const EditFacUserRole = (data: FacUserRoleModel) =>
    request({
        url: '/FacUserRoleAction/updateFacUserRole',
        method: 'post',
        data: data
    })

/**
* 删除内部用户角色
* @param  id number
*/
const DeleteFacUserRole = (id: number) =>
    request({
        url: '/FacUserRoleAction/deleteFacUserRole/' + id,
        method: 'get',
    })

export default {
    QueryRoleList,
    AddFacUserRole,
    EditFacUserRole,
    DeleteFacUserRole
}