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
  })
}

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

// 获取小黑屋用户列表
export function darkRoomList(query) {
  return request({
    url: '/his/user/darkRoomList',
    method: 'get',
    params: query
  })
}

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

// 获取黑名单用户列表
export function blacklist(query) {
  return request({
    url: '/his/user/blacklist',
    method: 'get',
    params: query
  })
}

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

// 添加积分
export function addPoint(data) {
  return request({
    url: '/his/user/addPoints',
    method: 'post',
    data: data
  })
}

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

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

// 解绑会员看课的会员和销售的关系
export function batchUnbindUser(data) {
  return request({
    url: '/his/user/batchUnbind',
    method: 'delete',
    data: data
  })
}
