import request from '@/utils/request'

export function getAllDmUser(params) {
  return request({
    url: 'api/dmUser/findNotBindUser',
    method: 'get',
    params
  })
}

export function getAllDmUserCard(params) {
  return request({
    url: 'api/dmUser/findNotUserCard',
    method: 'get',
    params
  })
}

export function getUser(params) {
  return request({
    url: 'api/dmUser/findUser',
    method: 'get',
    params
  })
}

export function getAll(params) {
  return request({
    url: 'api/dmUser',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'api/dmUser',
    method: 'post',
    data
  })
}

export function addUserDevice(data) {
  return request({
    url: 'api/dmUser/createUserDevice',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dmUser/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dmUser',
    method: 'put',
    data
  })
}

export function getByUserNumber(params) {
  return request({
    url: 'api/dmUser/findByUserNumber',
    method: 'get',
    params
  })
}
export function uploadPicture(params) {
  return request({
    url: '/api/localStorage/pictures',
    method: 'post',
    headers: { ContentType: 'multipart/form-data' },
    params
  })
}

export default { add, edit, del, getAll, addUserDevice, getByUserNumber, uploadPicture }
