import request from '@/utils/request'

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

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

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

export function autoById(id) {
  return request({
    url: `/api/v1/tenant/sn/auth/${id}`,
    method: 'post'
  })
}

export function autoCancelById(id) {
  return request({
    url: `/api/v1/tenant/sn/auth/cancel/${id}`,
    method: 'post'
  })
}
export function snList(data) {
  return request({
    url: '/api/v1/tenant/sn/list',
    method: 'post',
    data
  })
}
// 设备模版-新增-编辑
export function templateEdit(data) {
  return request({
    url: '/api/v1/tenant/template/edit',
    method: 'post',
    data
  })
}
// 设备模版列表
export function templateList(data) {
  return request({
    url: '/api/v1/tenant/template/list',
    method: 'get',
    params: {}
  })
}
// 设备模版列表(分页)
export function templatePage(data) {
  return request({
    url: '/api/v1/tenant/template/page',
    method: 'post',
    data
  })
}
// 设备模版-删除
export function templateDel(deviceTemplateId) {
  return request({
    url: `/api/v1/tenant/template/${deviceTemplateId}`,
    method: 'DELETE'
  })
}
// 设备模版列表
export function templateDetail(deviceTemplateId) {
  return request({
    url: '/api/v1/tenant/template/detail',
    method: 'get',
    params: { deviceTemplateId }
  })
}

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

// 获取阅读器 ic14443 / ic15693
export function getReaderBrand() {
  return request({
    url: '/api/v1/tenant/getReaderBrandEnum',
    method: 'get',
    params: {}
  })
}

// 获取二维码读头品牌
export function getQrCodeReaderBrandEnum() {
  return request({
    url: '/api/v1/tenant/sn/getQrCodeReaderBrandEnum',
    method: 'get',
    params: {}
  })
}

// 打印机型号
export function printerConfigList() {
  return request({
    url: '/api/v1/iot/device/config/printerConfigList',
    method: 'get',
    params: {}
  })
}

// 麦克风类型
export function microphoneTypeList() {
  return request({
    url: '/api/v1/iot/device/config/microphoneTypeList',
    method: 'get',
    params: {}
  })
}
