import request from '@/utils/request'

// 创建员工
export function createWorkersInfo(data) {
  return request({
    url: '/basic/workers-info/create',
    method: 'post',
    data: data
  })
}

// 更新员工
export function updateWorkersInfo(data) {
  return request({
    url: '/basic/workers-info/update',
    method: 'put',
    data: data
  })
}

// 删除员工
export function deleteWorkersInfo(id) {
  return request({
    url: '/basic/workers-info/delete?id=' + id,
    method: 'delete'
  })
}

// 获得员工
export function getWorkersInfo(id) {
  return request({
    url: '/basic/workers-info/get?id=' + id,
    method: 'get'
  })
}

// 获得员工分页
export function getWorkersInfoPage(query) {
  return request({
    url: '/basic/workers-info/page',
    method: 'get',
    params: query
  })
}

// 根据指定的商户昵称获取所有的员工列表
export function getFindByBelongBusinessId(params) {
  return request({
    url: '/basic/workers-info/getFindByBelongBusinessId',
    method: 'get',
    params,
  })
}

// 解绑微信
export function unbindingWX(id) {
  return request({
    url: '/basic/workers-info/unbindingWX?id=' + id,
    method: 'put'
  })
}
