import request from '@/utils/request'

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/his/user/list',
    method: 'get',
    params: query
  })
}

export function listBySearch(query) {
  return request({
    url: '/his/user/listBySearch',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function selectUser(name) {
  return request({
    url: '/his/user/user/list/' + name,
    method: 'get'
  })
}
export function getUser(userId) {
  return request({
    url: '/his/user/' + userId,
    method: 'get'
  })
}
// 查询用户详细
export function getUserAddr(userId) {
  return request({
    url: '/his/user/getUserAddr/' + userId,
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/his/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/his/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser(userId) {
  return request({
    url: '/his/user/' + userId,
    method: 'delete'
  })
}

// 导出用户
export function exportUser(query) {
  return request({
    url: '/his/user/export',
    method: 'get',
    params: query
  })
}
