import request from '@/utils/request'

/**
 * 操作员登录
 * @param {object} data 登录需要的参数，包括user_name和password
 * @returns 请求的结果，是一个promise对象
 */
export function operatorLogin(data) {
    return request({
        url: '/user/operatorLogin',
        method: 'post',
        data
    })
}

//增加
export function addOperator(data) {
    return request({
        url: '/user/addOperator',
        method: 'post',
        data
    })
}

//修改
export function updateOperator(data) {
    return request({
        url: '/user/updateOperator',
        method: 'post',
        data: data
    })
}

//修改密码
export function updateOperatorPwd(data) {
    return request({
        url: '/user/updateOperatorPwd',
        method: 'post',
        data: data
    })
}

//重置密码
export function resetOperatorPwd(data) {
    return request({
        url: '/user/resetOperatorPwd',
        method: 'post',
        data: data
    })
}

//删除
export function deleteOperator(data) {
    return request({
        url: '/user/deleteOperator',
        method: 'post',
        data: data
    })
}

//获得某条记录
export function getOperatorById(data) {
    return request({
        url: '/user/getOperatorById',
        method: 'post',
        data: data
    })
}

//获得分页数据
export function getOperatorPageList(data) {
    return request({
        url: '/user/getOperatorPageList',
        method: 'post',
        data: data
    })
}

//根据公司ID获得该公司的系统管理员数据
export function getSysOperatorByCompanyId(data) {
    return request({
        url: '/user/getSysOperatorByCompanyId',
        method: 'post',
        data: data
    })
}



//增加
export function addRole(data) {
    return request({
        url: '/user/addRole',
        method: 'post',
        data: data
    })
}

//修改
export function updateRole(data) {
    return request({
        url: '/user/updateRole',
        method: 'post',
        data: data
    })
}

//删除
export function deleteRole(data) {
    return request({
        url: '/user/deleteRole',
        method: 'post',
        data: data
    })
}

//获得某条记录
export function getRoleById(data) {
    return request({
        url: '/user/getRoleById',
        method: 'post',
        data: data
    })
}


//获得分页数据
export function getRolePageList(data) {
    return request({
        url: '/user/getRolePageList',
        method: 'post',
        data: data
    })
}


//增加
export function addPermission(data) {
    return request({
        url: '/user/addPermission',
        method: 'post',
        data: data
    })
}

//修改
export function updatePermission(data) {
    return request({
        url: '/user/updatePermission',
        method: 'post',
        data: data
    })
}

//删除
export function deletePermission(data) {
    return request({
        url: '/user/deletePermission',
        method: 'post',
        data: data
    })
}

//获得某条记录
export function getPermissionById(data) {
    return request({
        url: '/user/getPermissionById',
        method: 'post',
        data: data
    })
}

//获得全部数据
export function getPermissionList() {
    return request({
        url: '/user/getPermissionList',
        method: 'post',
    })
}

//获得分页数据
export function getPermissionPageList(data) {
    return request({
        url: '/user/getPermissionPageList',
        method: 'post',
        data: data
    })
}

//获得操作员权限
export function getOperatorPermission() {
    return request({
        url: '/user/getOperatorPermission',
        method: 'post',
        data: { id: 0 }
    })
}