import { axios } from '@/utils/request'

// 获取采集员列表数据
export const getCollectorList = params => {
  const url = `gatherUser/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 重置密码
export const resetPSD = params => {
  return axios({
    url: `gatherUser/resetPwd/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 改变状态接口
export const updateEnableStatus = params => {
  return axios({
    url: `gatherUser/enable/${params.id}/${params.flag}`,
    data: {},
    method: 'get'
  })
}

// 删除
export const delectCollector = params => {
  return axios({
    url: `gatherUser/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 新增/编辑保存
export const saveCollector = params => {
  return axios({
    url: 'gatherUser/save',
    data: params,
    method: 'POST'
  })
}

// 编辑查详情
export const collectorDetails = (params) => {
  const url = `gatherUser/getById/${params.id}`
  return axios({
    url: url,
    data: params,
    method: 'get'
  })
}
