import { FacUserModel,FacUserQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取内部用户列表
 * @param data FacUserQueryParam
 */
const QueryFacUserList = (data: FacUserQueryParam) =>
    request({
        url: '/FacUserAction/list',
        method: 'post',
        data: data
    })

/**
* 新增内部用户
* @param data FacUser
*/
const AddFacUser = (data: FacUserModel) =>
    request({
        url: '/FacUserAction/saveFacUser',
        method: 'post',
        data: data
    })

/**
* 编辑内部用户
* @param data FacUser
*/
const EditFacUser = (data: FacUserModel) =>
    request({
        url: '/FacUserAction/updateFacUser',
        method: 'post',
        data: data
    })

/**
* 删除内部用户
* @param  id number
*/
const DeleteFacUser = (id: number) =>
    request({
        url: '/FacUserAction/deleteFacUser/' + id,
        method: 'get',
    })

/**
* 内部用户登陆
* @param loginId string
* @param loginPwd string
*/
const Login = (loginId: string, loginPwd: string) =>
    request({
        url: '/FacUserAction/loginFacuser/' + loginId + "/" + loginPwd,
        method: 'get',
    })

export default {
    QueryFacUserList,
    AddFacUser,
    EditFacUser,
    DeleteFacUser,
    Login
}