import request from '@/utils/request'

export function getUsers(params) {

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

export function getAllDmUser(params) {
  /* const params = {
    page: 0,
    size: 9999,
    enabled: true
  } */
  var requestUrl = 'api/dmUser/findNotBindUser'
  if(params != null){
	  requestUrl += '?userId=' + params
  }
  return request({
    // url: 'api/dmUser/findNotBindUser?userId='+params,
    url: requestUrl,
    method: 'get'
  })
}

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

export function add(data) {
  return request({
    url: 'api/dmUser',
    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 default { add, edit, del, getUsers }
