import request from '@/utils/request'
/************物联硬件************/
//物联分类列表
export function iotDeviceList(data) {
  return request({
    url: '/iot/device/list',
    method: 'post',
    data: data
  })
}
//设备类型下啦列表
export function iotTypeGetAllTypes(query) {
  return request({
    url: '/iot/type/getAllTypes',
    method: 'get',
    params: query
  })
}

//设备类型配置查询
export function iotTypeGetParamByTypeId(query) {
  return request({
    url: '/iot/type/getParamByTypeId',
    method: 'get',
    params: query
  })
}
//通过设备类型查询设备属性
export function iotAttributeGetByTypeId(query) {
  return request({
    url: '/iot/attribute/getByTypeId',
    method: 'get',
    params: query
  })
}
//通过设备typeKey查询设备属性
export function iotAttributeGetByTypeKey(query) {
  return request({
    url: '/iot/attribute/getByTypeKey',
    method: 'get',
    params: query
  })
}

//新增设备
export function iotDeviceAdd(data) {
  return request({
    url: '/iot/device/add',
    method: 'post',
    data: data
  })
}
//设备详情
export function iotDeviceDetail(query) {
  return request({
    url: '/iot/device/detail',
    method: 'get',
    params: query
  })
}
//编辑设备
export function iotDeviceUpdate(data) {
  return request({
    url: '/iot/device/update',
    method: 'post',
    data: data
  })
}
//删除设备
export function iotDeviceDelete(data) {
  return request({
    url: '/iot/device/delete',
    method: 'post',
    data: data
  })
}
//物联设备在线数量
export function iotDeviceDeviceCount(query) {
  return request({
    url: '/iot/device/deviceCount',
    method: 'get',
    params: query
  })
}
//根据设备ID-查询设备功能列表
export function iotTypeFunctionList(data) {
  return request({
    url: '/iot/type/function/list',
    method: 'post',
    data: data
  })
}
//根据设备ID-新增设备功能
export function iotTypeFunctionAdd(data) {
  return request({
    url: '/iot/type/function/add',
    method: 'post',
    data: data
  })
}
//根据设备ID-编辑设备功能
export function iotTypeFunctionUpdate(data) {
  return request({
    url: '/iot/type/function/update',
    method: 'post',
    data: data
  })
}
//根据设备ID-删除设备功能
export function iotTypeFunctionDelete(data) {
  return request({
    url: '/iot/type/function/delete',
    method: 'post',
    data: data
  })
}
//根据设备ID-获取功能下拉列表
export function iotTypeFunctionDropList(data) {
  return request({
    url: '/iot/type/function/dropList',
    method: 'post',
    data: data
  })
}
//根据类型ID-获取未设备列表
export function iotDeviceExtraDeviceList(data) {
  return request({
    url: '/iot/device/extraDeviceList',
    method: 'post',
    data: data
  })
}
//批量添加-设备
export function iotDeviceAddBatch(data) {
  return request({
    url: '/iot/device/addBatch',
    method: 'post',
    data: data
  })
}
//物联设备-查询传感器LOG日志
export function iotDeviceDataList(data) {
  return request({
    url: '/iot/deviceData/list',
    method: 'post',
    data: data
  })
}
//物联设备-查询设备日志类型
export function iotDeviceLogType(query) {
  return request({
    url: '/iot/device/log/type',
    method: 'get',
    params: query
  })
}
//物联设备-根据设备ID查询设备日志
export function iotDeviceLogList(data) {
  return request({
    url: '/iot/device/log/list',
    method: 'post',
    data: data
  })
}
/************物联分类************/
//物联分类列表
export function iotTypeList(data) {
  return request({
    url: '/iot/type/list',
    method: 'post',
    data: data
  })
}
//获取物联分类标识
export function iotTypeGetTypeKey(query) {
  return request({
    url: '/iot/type/getTypeKey',
    method: 'get',
    params: query
  })
}
//新增物联分类
export function iotTypeAdd(data) {
  return request({
    url: '/iot/type/add',
    method: 'post',
    data: data
  })
}

//编辑物联分类
export function iotTypeUpdate(data) {
  return request({
    url: '/iot/type/update',
    method: 'post',
    data: data
  })
}

//物联分类删除
export function iotTypeDelete(data) {
  return request({
    url: '/iot/type/delete',
    method: 'post',
    data: data
  })
}

//物联分类详情
export function iotTypeDetail(query) {
  return request({
    url: '/iot/type/detail',
    method: 'get',
    params: query
  })
}

//物联分类-配置-属性列表
export function iotAttributeList(data) {
  return request({
    url: '/iot/attribute/list',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性新增
export function iotAttributeAdd(data) {
  return request({
    url: '/iot/attribute/add',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性编辑
export function iotAttributeUpdate(data) {
  return request({
    url: '/iot/attribute/update',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性删除
export function iotAttributeDelete(data) {
  return request({
    url: '/iot/attribute/delete',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性详情
export function iotAttributeDetail(query) {
  return request({
    url: '/iot/attribute/detail',
    method: 'get',
    params: query
  })
}

//物联分类-配置-属性上移
export function iotAttributeMoveUp(data) {
  return request({
    url: '/iot/attribute/moveUp',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性下移
export function iotAttributeMoveDown(data) {
  return request({
    url: '/iot/attribute/moveDown',
    method: 'post',
    data: data
  })
}

//物联分类-配置-属性类别(分类下的子标识)列表
export function iotAttributeAttrType(query) {
  return request({
    url: '/iot/attribute/attrType',
    method: 'get',
    params: query
  })
}
//物联分类-配置-模块列表
export function iotTypeTypeModelAndAttr(query) {
  return request({
    url: '/iot/type/typeModelAndAttr',
    method: 'get',
    params: query
  })
}

//物联分类-配置-模块
export function iotTypeSaveTypeModel(data) {
  return request({
    url: '/iot/type/saveTypeModel',
    method: 'post',
    data: data
  })
}

/***********分类配置*************/

//分类配置列表
export function iotParamList(data) {
  return request({
    url: '/iot/param/list',
    method: 'post',
    data: data
  })
}

//分类配置添加
export function iotParamAdd(data) {
  return request({
    url: '/iot/param/add',
    method: 'post',
    data: data
  })
}

//分类配置编辑
export function iotParamUpdate(data) {
  return request({
    url: '/iot/param/update',
    method: 'post',
    data: data
  })
}

//分类配置删除
export function iotParamDelete(data) {
  return request({
    url: '/iot/param/delete',
    method: 'post',
    data: data
  })
}

//分类配置详情
export function iotParamDetail(query) {
  return request({
    url: '/iot/param/detail',
    method: 'get',
    params: query
  })
}

//分类配置展示
export function iotParamAll(data) {
  return request({
    url: '/iot/param/all',
    method: 'post',
    data: data
  })
}

//分类配置上移
export function iotParamMoveUp(data) {
  return request({
    url: '/iot/param/moveUp',
    method: 'post',
    data: data
  })
}
//分类配置下移
export function iotParamMoveDown(data) {
  return request({
    url: '/iot/param/moveDown',
    method: 'post',
    data: data
  })
}

//分类配置字典列表
export function iotParamValueList(data) {
  return request({
    url: '/iot/paramValue/list',
    method: 'post',
    data: data
  })
}
//分类配置字典新增
export function iotParamValueAdd(data) {
  return request({
    url: '/iot/paramValue/add',
    method: 'post',
    data: data
  })
}
//分类配置字典编辑
export function iotParamValueUpdate(data) {
  return request({
    url: '/iot/paramValue/update',
    method: 'post',
    data: data
  })
}
//分类配置字典删除
export function iotParamValueDelete(data) {
  return request({
    url: '/iot/paramValue/delete',
    method: 'post',
    data: data
  })
}
//分类配置字典详情
export function iotParamValueDetail(query) {
  return request({
    url: '/iot/paramValue/detail',
    method: 'get',
    params: query
  })
}

/***********告警方式*************/
//方式列表
export function iotAlarmType(query) {
  return request({
    url: '/iot/alarm/type',
    method: 'get',
    params: query
  })
}

//告警方式列表
export function iotAlarmTypeList(data) {
  return request({
    url: '/iot/alarm/type/list',
    method: 'post',
    data: data
  })
}

//告警方式新增
export function iotAlarmTypeAdd(data) {
  return request({
    url: '/iot/alarm/type/add',
    method: 'post',
    data: data
  })
}

//告警方式编辑
export function iotAlarmTypeUpdate(data) {
  return request({
    url: '/iot/alarm/type/update',
    method: 'post',
    data: data
  })
}

//告警方式删除
export function iotAlarmTypeDelete(data) {
  return request({
    url: '/iot/alarm/type/delete',
    method: 'post',
    data: data
  })
}

//告警方式启用&禁用
export function iotAlarmTypeChangeState(data) {
  return request({
    url: '/iot/alarm/type/changeState',
    method: 'post',
    data: data
  })
}

/***********消息模板*************/
//消息模板-下拉列表
export function iotAlarmTemplateDrop(data) {
  return request({
    url: '/iot/alarm/template/drop',
    method: 'post',
    data: data
  })
}
//消息模板列表
export function iotAlarmTemplateList(data) {
  return request({
    url: '/iot/alarm/template/list',
    method: 'post',
    data: data
  })
}

//消息模板新增
export function iotAlarmTemplateAdd(data) {
  return request({
    url: '/iot/alarm/template/add',
    method: 'post',
    data: data
  })
}

//消息模板编辑
export function iotAlarmTemplateUpdate(data) {
  return request({
    url: '/iot/alarm/template/update',
    method: 'post',
    data: data
  })
}

//消息模板删除
export function iotAlarmTemplateDelete(data) {
  return request({
    url: '/iot/alarm/template/delete',
    method: 'post',
    data: data
  })
}
//消息模板-发送调试信息
export function iotAlarmSendCheck(data) {
  return request({
    url: '/iot/alarm/send/check',
    method: 'post',
    data: data
  })
}


//消息模板启用&禁用
export function iotAlarmTemplateChangeState(data) {
  return request({
    url: '/iot/alarm/template/changeState',
    method: 'post',
    data: data
  })
}

//获取消息模板类型列表
export function iotAlarmTemplateBodyType(query) {
  return request({
    url: '/iot/alarm/template/bodyType',
    method: 'get',
    params: query
  })
}
//短信发送业务类型(预案短信/化学品短信/气瓶短信)
export function iotAlarmTemplateBusinessType(query) {
  return request({
    url: '/iot/alarm/template/businessType',
    method: 'get',
    params: query
  })
}


/***********网络组件*************/
/*
网络组件-下拉列表or组件详情查询
isList:下拉列表查询时传true
id:详情查询时传入ID
*/
export function iotNetworkInfo(query) {
  return request({
    url: '/iot/network/info',
    method: 'get',
    params: query
  })
}
//网络组件-列表
export function iotNetworkList(data) {
  return request({
    url: '/iot/network/list',
    method: 'post',
    data: data
  })
}
//网络组件-新增
export function iotNetworkAdd(data) {
  return request({
    url: '/iot/network/add',
    method: 'post',
    data: data
  })
}
//网络组件-修改
export function iotNetworkUpdate(data) {
  return request({
    url: '/iot/network/update',
    method: 'post',
    data: data
  })
}
//网络组件-删除
export function iotNetworkDelete(data) {
  return request({
    url: '/iot/network/delete',
    method: 'post',
    data: data
  })
}
//网络组件-详情
export function iotNetworkDetail(data) {
  return request({
    url: '/iot/network/detail',
    method: 'post',
    data: data
  })
}
/***************** 协议管理 *****************/
//协议管理-列表
export function iotProtocolList(data) {
  return request({
    url: '/iot/protocol/list',
    method: 'post',
    data: data
  })
}
//协议管理-新增
export function iotProtocolAdd(data) {
  return request({
    url: '/iot/protocol/add',
    method: 'post',
    data: data
  })
}
//协议管理-编辑
export function iotProtocolUpdate(data) {
  return request({
    url: '/iot/protocol/update',
    method: 'post',
    data: data
  })
}
//协议管理-删除
export function iotProtocolDelete(data) {
  return request({
    url: '/iot/protocol/delete',
    method: 'post',
    data: data
  })
}
/***************** 硬件分类 *****************/
//硬件分类-新增
export function iotHardwareTypeAdd(data) {
  return request({
    url: '/iot/hardwareType/add',
    method: 'post',
    data: data
  })
}
//硬件分类-编辑
export function iotHardwareTypeUpdate(data) {
  return request({
    url: '/iot/hardwareType/update',
    method: 'post',
    data: data
  })
}
//硬件分类-列表
export function iotHardwareTypeList(data) {
  return request({
    url: '/iot/hardwareType/list',
    method: 'post',
    data: data
  })
}
//硬件分类-删除
export function iotHardwareTypeDelete(data) {
  return request({
    url: '/iot/hardwareType/delete',
    method: 'post',
    data: data
  })
}
//硬件分类-详情
export function iotHardwareTypeDetail(query) {
  return request({
    url: '/iot/hardwareType/detail',
    method: 'get',
    params: query
  })
}
//硬件分类-获取分类标识列表
export function iotHardwareTypeGetTypeKey(query) {
  return request({
    url: '/iot/hardwareType/getTypeKey',
    method: 'get',
    params: query
  })
}
//硬件分类-功能下拉列表
export function iotHardwareFunctionDropList(data) {
  return request({
    url: '/iot/hardware/function/dropList',
    method: 'post',
    data: data
  })
}
//硬件分类-功能列表
export function iotHardwareFunctionList(data) {
  return request({
    url: '/iot/hardware/function/list',
    method: 'post',
    data: data
  })
}
//硬件分类-功能新增
export function iotHardwareFunctionAdd(data) {
  return request({
    url: '/iot/hardware/function/add',
    method: 'post',
    data: data
  })
}
//硬件分类-功能编辑
export function iotHardwareFunctionUpdate(data) {
  return request({
    url: '/iot/hardware/function/update',
    method: 'post',
    data: data
  })
}
//硬件分类-功能删除
export function iotHardwareFunctionDelete(data) {
  return request({
    url: '/iot/hardware/function/delete',
    method: 'post',
    data: data
  })
}
/*********** 硬件设备 ************/
//硬件设备-新增
export function iotHardwareAdd(data) {
  return request({
    url: '/iot/hardware/add',
    method: 'post',
    data: data
  })
}
//硬件设备-编辑
export function iotHardwareUpdate(data) {
  return request({
    url: '/iot/hardware/update',
    method: 'post',
    data: data
  })
}
//硬件设备-列表
export function iotHardwareList(data) {
  return request({
    url: '/iot/hardware/list',
    method: 'post',
    data: data
  })
}
//硬件设备-详情
export function iotHardwareDetail(query) {
  return request({
    url: '/iot/hardware/detail',
    method: 'get',
    params: query
  })
}
//硬件设备-删除
export function iotHardwareDelete(data) {
  return request({
    url: '/iot/hardware/delete',
    method: 'post',
    data: data
  })
}
//硬件设备-新增-获取硬件分类
export function iotHardwareTypeFindHardwareType(data) {
  return request({
    url: '/iot/hardwareType/findHardwareType',
    method: 'post',
    data: data
  })
}
//硬件设备-硬件日志
export function iotHardwareLogList(data) {
  return request({
    url: '/iot/hardware/log/list',
    method: 'post',
    data: data
  })
}
/***********接收人*************/

//获取接收人-列表
export function iotAlarmReceiveList(data) {
  return request({
    url: '/iot/alarm/receive/list',
    method: 'post',
    data: data
  })
}
//获取接收人-新增
export function iotAlarmReceiveAdd(data) {
  return request({
    url: '/iot/alarm/receive/add',
    method: 'post',
    data: data
  })
}
//获取接收人-删除
export function iotAlarmReceiveDelete(data) {
  return request({
    url: '/iot/alarm/receive/delete',
    method: 'post',
    data: data
  })
}
//获取接收人-编辑
export function iotAlarmReceiveUpdate(data) {
  return request({
    url: '/iot/alarm/receive/update',
    method: 'post',
    data: data
  })
}
//获取接收人-下拉列表
export function iotAlarmReceiveDropList(data) {
  return request({
    url: '/iot/alarm/receive/dropList',
    method: 'post',
    data: data
  })
}

//消息日志-列表
export function iotAlarmLogList(data) {
  return request({
    url: '/iot/alarm/log/list',
    method: 'post',
    data: data
  })
}
/************************* 监控配置 *************************/
//设备监控-列表
export function iotMonitorConfigList(data) {
  return request({
    url: '/iot/monitor/config/list',
    method: 'post',
    data: data
  })
}
//设备监控-新增
export function iotMonitorConfigAdd(data) {
  return request({
    url: '/iot/monitor/config/add',
    method: 'post',
    data: data
  })
}
//设备监控-编辑
export function iotMonitorConfigUpdate(data) {
  return request({
    url: '/iot/monitor/config/update',
    method: 'post',
    data: data
  })
}
//设备监控-删除
export function iotMonitorConfigDelete(data) {
  return request({
    url: '/iot/monitor/config/delete',
    method: 'post',
    data: data
  })
}
//设备监控-详情
export function iotMonitorConfigDetail(query) {
  return request({
    url: '/iot/monitor/config/detail',
    method: 'get',
    params: query
  })
}
//设备监控日志-列表
export function iotMonitorLogList(data) {
  return request({
    url: '/iot/monitor/log/list',
    method: 'post',
    data: data
  })
}
/******************** 应用管理 ********************/
//应用列表-列表
export function iotAppInfoList(data) {
  return request({
    url: '/iot/app/info/list',
    method: 'post',
    data: data
  })
}
//应用列表-新增
export function iotAppInfoAdd(data) {
  return request({
    url: '/iot/app/info/add',
    method: 'post',
    data: data
  })
}
//应用列表-编辑
export function iotAppInfoUpdate(data) {
  return request({
    url: '/iot/app/info/update',
    method: 'post',
    data: data
  })
}
//应用列表-删除
export function iotAppInfoDelete(data) {
  return request({
    url: '/iot/app/info/delete',
    method: 'post',
    data: data
  })
}
//应用列表-获取应用版本号
export function iotAppInfoGetLastVersion(query) {
  return request({
    url: '/iot/app/info/getLastVersion',
    method: 'get',
    params: query
  })
}
//应用列表-code列表
export function iotAppInfoGetCodeList(query) {
  return request({
    url: '/iot/app/info/getCodeList',
    method: 'get',
    params: query
  })
}
//应用列表-获取可升级设备列表
export function iotAppInfoUpgradeDevices(data) {
  return request({
    url: '/iot/app/info/upgradeDevices',
    method: 'post',
    data: data
  })
}
//应用列表-批量升级
export function iotAppInfoBatchUpgrade(data) {
  return request({
    url: '/iot/app/info/batchUpgrade',
    method: 'post',
    data: data
  })
}
//应用升级-列表
export function iotAppUpgradeList(data) {
  return request({
    url: '/iot/app/upgrade/list',
    method: 'post',
    data: data
  })
}
//应用升级-撤销升级
export function iotAppUpgradeDelete(data) {
  return request({
    url: '/iot/app/upgrade/delete',
    method: 'post',
    data: data
  })
}

/********************* 物联管理首页 *********************/
//统计-设备在线离线
export function iotStatisticsDeviceOnline(query) {
  return request({
    url: '/iot/statistics/deviceOnline',
    method: 'get',
    params: query
  })
}

//统计-设备分类
export function iotStatisticsDeviceType(query) {
  return request({
    url: '/iot/statistics/deviceType',
    method: 'get',
    params: query
  })
}
//统计-设备统计
export function iotStatisticsDevices(query) {
  return request({
    url: '/iot/statistics/devices',
    method: 'get',
    params: query
  })
}
//统计-告警消息统计
export function iotStatisticsMessages(query) {
  return request({
    url: '/iot/statistics/messages',
    method: 'get',
    params: query
  })
}
//统计-消息列表
export function iotAlarmLogMessages(data) {
  return request({
    url: '/iot/alarm/log/select',
    method: 'post',
    data: data
  })
}
