import request from '@/utils/request'

export function doGetFaceDevices(params) {
  return request({
    url: '/admin/face/doGetFaceDevices',
    method: 'post',
    data: params
  })
}

export function doEditFaceDevices(params) {
  return request({
    url: '/admin/face/doEditFaceDevices',
    method: 'post',
    data: params
  })
}

export function doDeleteDevice(params) {
  return request({
    url: '/admin/face/doDeleteDevice/' + params,
    method: 'delete'
  })
}

export function doAuthFaceDevice(params) {
  return request({
    url: '/admin/face/doAuthFaceDevice/' + params,
    method: 'get'
  })
}

export function doStopFaceDevice(params) {
  return request({
    url: '/admin/face/doStopFaceDevice/' + params,
    method: 'get'
  })
}

export function doGetFacePass(params) {
  return request({
    url: '/admin/face/doGetFacePass',
    method: 'post',
    data: params
  })
}

export function doGetFaceServerLog(params) {
  return request({
    url: '/admin/face/doGetFaceServerLog',
    method: 'post',
    data: params
  })
}

export function doGetUsers(params) {
  return request({
    url: '/admin/face/doGetUsers',
    method: 'post',
    data: params
  })
}

export function downloadFaceLog(data) {
  return request({
    url: '/admin/face/doGetFaceServerLogExcel',
    method: 'post',
    data: data
  })
}

// 查询详情
export function getDetails(data) {
  return request({
    url: '/admin/face/getDetails',
    method: 'post',
    data: data
  })
}

/***********************************zyh_加入-设备列表*************************************************/

// 获取设备编号
export function getFaceDeviceList() {
  return request({
    url: '/admin/face/getFaceDeviceList',
    method: 'post',
    data: {}
  })
}

// 全量下发
export function issueAll(data) {
  return request({
    url: '/admin/userWhitelis/addSnIssued',
    method: 'get',
    params: data
  })
}

// 重新下发
export function reIssue(id) {
  return request({
    url: '/admin/userWhitelis/addSingle',
    method: 'get',
    params: {
      id: id
    }
  })
}

// 重新启动
export function restart(sn) {
  return request({
    url: '/admin/face/doReboot',
    method: 'get',
    params: {
      sn: sn
    }
  })
}

/***********************************zyh_加入_logo管理*************************************************/

// 获得logo
export function getLogo() {
  return request({
    url: '/admin/face/getLogo',
    method: 'get',
    params: {}
  })
}

// 上传logo
export function uploadImage(data) {
  return request({
    url: '/upload/picture',
    method: 'post',
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data
  })
}

// 下发logo
export function issuedAll(data) {
  return request({
    url: '/admin/face/issuedAll',
    method: 'get',
    params: data
  })
}

/***********************************zyh_加入_系统设置_查询详情配置*************************************************/

// 获取查询详情配置列表
export function getCheckContentList(data) {
  return request({
    url: '/admin/sysInquire/getList',
    method: 'post',
    data: data
  })
}

// 添加or修改
export function addOrUpdateCheckContent(data) {
  return request({
    url: '/admin/sysInquire/addOrUpdate',
    method: 'post',
    data: data
  })
}


// 删除
export function deleteCheckContent(id) {
  return request({
    url: '/admin/sysInquire/delete',
    method: 'DELETE',
    params: {
      id: id
    }
  })
}

/***********************************zyh_加入_系统设置_第三方设备设置*************************************************/

// 获取第三方设备名称列表
export function getMachineCompanyList(data) {
  return request({
    url: '/admin/thirdParty/getPageList',
    method: 'post',
    data: data
  })
}

// 获取第三方设备名称列表-搜索
export function getMachineCompanyListSearch() {
  return request({
    url: '/admin/thirdParty/getList',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: {}
  })
}

// 获取第三方设备名称列表-搜索
export function getFaceLogStatusEnumSearch() {
  return request({
    url: '/admin/face/getFaceLogStatusEnum',
    method: 'get',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: {}
  })
}

// 添加or修改
export function addOrUpdateMachineCompany(data) {
  return request({
    url: '/admin/thirdParty/edit',
    method: 'post',
    data: data
  })
}


// 删除
export function deleteMachineCompany(thirdPartyId) {
  return request({
    url: '/admin/thirdParty/delete',
    method: 'get',
    params: {
      thirdPartyId: thirdPartyId
    }
  })
}


/***********************************zyh_加入_系统设置_第三方设备设置*************************************************/

// 获取第三方设备名称列表
export function getMachineTypeList(data) {
  return request({
    url: '/admin/deviceType/getPageList',
    method: 'post',
    data: data
  })
}

// 获取第三方设备名称列表-搜索
export function getMachineTypeListSearch() {
  return request({
    url: '/admin/deviceType/getList',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: {}
  })
}

// 添加or修改
export function addOrUpdateMachineType(data) {
  return request({
    url: '/admin/deviceType/addOrEdit',
    method: 'post',
    data: data
  })
}


// 删除
export function deleteMachineType(faceDeviceTypeId) {
  return request({
    url: '/admin/deviceType/deleteType',
    method: 'get',
    params: {
      faceDeviceTypeId: faceDeviceTypeId
    }
  })
}
