import request from '@/utils/request'

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

export function myListUser(query) {
  return request({
    url: '/store/user/myList',
    method: 'get',
    params: query
  })
}

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

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

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

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

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

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

// 小黑屋
export function darkRoomList(query) {
  return request({
    url: '/store/user/darkRoomList',
    method: 'get',
    params: query
  })
}

// 批量解禁
export function enabledUsers(data) {
  return request({
    url: '/store/user/enabledUsers',
    method: 'post',
    data: data
  })
}
