import request from '@/config/request';

export const APICommand = {
  commandList, //获取设备所有指令列表
  sendCommand, //发送一个指令给设备
  SetIotWhiteList, // 设置白名单
  Effective, //中亿SIM自动激活接口
  CheckImei, //检查imei属于哪家厂商
  GetCardInfo, //获取小台风物联网卡信息
  HealthCode, //健康码
  ocr, //ocr识别
  GetHealthCodeList, ///api/Command/GetHealthCodeList
  CheckHealthCodeAuth, //检查该设备 健康码是否已经授权
  SetPayPassword, //修改支付密码
  NucleicCode, // 新增核酸码
  GetNucleicCode, //获取核酸码记录
  GetIotCardWiteList, //获取第三方亲情号码同步状态
  CheckImeiHealth, //检查是否可以显示核酸码菜单
  setFlyModePwd, //设置飞行模式密码
  setPicUrl, //设置设备卡片头像参数
  getPicUrl, //获取设备头像参数
  setSchoolName, //设置设备卡片学校名称参数
  getSchoolName, //获取设备卡片学校名称参数
  setClassAndName, //设置设备卡片班级名称参数
  getClassAndName, //获取设备卡片班级名称参数
  setIotCtlMode, //设置设备iot连接控制属性
  getIotCtlMode, //获取设备iot连接控制属性
  SetBloodPressCalibrationConfig, //设置设备血压标定参数
  GetBloodPressCalibrationConfig //获取设备血压标定参数
};

// 获取设备所有指令列表
function commandList(params) {
  return request({
    url: '/api/Command/CommandList',
    method: 'post',
    data: params
  });
}

//发送一个指令给设备
function sendCommand(params) {
  return request({
    url: '/api/Command/SendCommand',
    method: 'post',
    data: params
  });
}
//设置白名单
function SetIotWhiteList(params) {
  return request({
    url: '/api/Command/SetIotWhiteList',
    method: 'post',
    data: params
  });
}

// 中亿SIM自动激活接口
function Effective(params) {
  return request({
    url: '/api/Command/Effective',
    method: 'post',
    data: params
  });
}
//检查imei属于哪家厂商
function CheckImei(params) {
  return request({
    url: '/api/Command/CheckImei',
    method: 'post',
    data: params
  });
}
//获取小台风物联网卡信息
function GetCardInfo(params) {
  return request({
    url: '/api/Command/GetCardInfo',
    method: 'post',
    data: params
  });
}
function HealthCode(params) {
  return request({
    url: '/api/Command/HealthCode',
    headers: { AuthKey: 'key1' },
    method: 'post',
    data: params
  });
}
function ocr(params) {
  return request({
    url: '/api/Command/WxIdCardOcr',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function GetHealthCodeList(imei) {
  return request({
    url: '/api/Command/GetHealthCodeList',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
function CheckHealthCodeAuth(params) {
  return request({
    url: '/api/Command/CheckHealthCodeAuth',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function SetPayPassword(params) {
  return request({
    url: '/api/Command/SetPayPassword',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}

function NucleicCode(params) {
  return request({
    url: '/api/Command/NucleicCode',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function GetNucleicCode(params) {
  return request({
    url: '/api/Command/GetNucleicCode',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function GetIotCardWiteList(imei) {
  return request({
    url: '/api/Command/GetIotCardWiteList',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
function CheckImeiHealth(params) {
  return request({
    url: '/api/Command/CheckImeiHealth',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function setFlyModePwd(params) {
  return request({
    url: '/api/Command/setFlyModePwd',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function setPicUrl(params) {
  return request({
    url: '/api/Command/SetPicUrl',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function getPicUrl(imei) {
  return request({
    url: '/api/Command/GetPicUrl',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}

function setSchoolName(params) {
  return request({
    url: '/api/Command/SetSchoolName',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function getSchoolName(imei) {
  return request({
    url: '/api/Command/GetSchoolName',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
function setClassAndName(params) {
  return request({
    url: '/api/Command/SetClassAndName',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function getClassAndName(imei) {
  return request({
    url: '/api/Command/GetClassAndName',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
function setIotCtlMode(params) {
  return request({
    url: '/api/Command/SetIotCtlMode',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function SetBloodPressCalibrationConfig(params) {
  return request({
    url: '/api/Command/SetBloodPressCalibrationConfig',
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}

function getIotCtlMode(imei) {
  return request({
    url: '/api/Command/GetIotCtlMode',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
function GetBloodPressCalibrationConfig(imei) {
  return request({
    url: '/api/Command/GetBloodPressCalibrationConfig',
    method: 'get',
    headers: { AuthKey: 'key1' },
    params: { imei }
  });
}
export default APICommand;
