import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/api/v1/hh/local/device/page',
    method: 'post',
    data
  })
}

export function add(data) {
  return request({
    url: '/api/v1/hh/local/device/add',
    method: 'post',
    // headers: { 'content-type': 'application/json' },
    data
  })
}

export function deleteById(id) {
  return request({
    url: `/api/v1/hh/local/device/del/${id}`,
    method: 'post'
  })
}

export function autoById(deviceId) {
  return request({
    url: `/api/v1/hh/local/device/enable?deviceId=` + deviceId,
    method: 'get'
  })
}

export function autoCancelById(deviceId) {
  return request({
    url: `/api/v1/hh/local/device/disable?deviceId=` + deviceId,
    method: 'get'
  })
}
// 设备模版-新增-编辑
export function templateEdit(data) {
  return request({
    url: '/api/v1/hh/local/device/template/edit',
    method: 'post',
    data
  })
}
// 设备模版列表
export function templateList(data) {
  return request({
    url: '/api/v1/hh/local/device/template/list',
    method: 'get',
    params: {}
  })
}
// 设备模版列表(分页)
export function templatePage(data) {
  return request({
    url: '/api/v1/hh/local/device/template/page',
    method: 'post',
    data
  })
}
// 设备模版-删除
export function templateDel(deviceTemplateId) {
  return request({
    url: `/api/v1/hh/local/device/template/${deviceTemplateId}`,
    method: 'DELETE'
  })
}
// 设备模版列表
export function templateDetail(deviceTemplateId) {
  return request({
    url: '/api/v1/hh/local/device/template/detail',
    method: 'get',
    params: { deviceTemplateId }
  })
}

// 获取身份证阅读器
export function getIdCardReaderBrand() {
  return request({
    url: '/api/v1/tenant/sn/getIdCardReaderBrand',
    method: 'get',
    params: {}
  })
}

// 获取摄像头类型
export function getCameraTypeEnum() {
  return request({
    url: '/api/v1/hh/local/device/getCameraTypeEnum',
    method: 'get',
    params: {}
  })
}

// 获取活体检测模式
export function getLiveTypeEnum() {
  return request({
    url: '/api/v1/hh/local/device/getLiveTypeEnum',
    method: 'get',
    params: {}
  })
}

// 记录类型下拉
export function getPushFailedRecordTypeEnum() {
  return request({
    url: '/api/v1/tenant/sn/getPushFailedRecordTypeEnum',
    method: 'get',
    params: {}
  })
}

// 成功显示人员信息下拉
export function getSuccessShowPersonalInfoListEnum() {
  return request({
    url: '/api/v1/hh/local/device/getSuccessShowPersonalInfoListEnum',
    method: 'get',
    params: {}
  })
}

// 设置——人员列表
export function getSetPersonalListEnum() {
  return request({
    url: '/api/v1/hh/local/device/getSetPersonalListEnum',
    method: 'get',
    params: {}
  })
}

// 获取设备编号(sn)列表
export function getDeviceSNList() {
  return request({
    url: '/api/v1/hh/local/device/sn/list',
    method: 'post',
    params: {}
  })
}
