import request from '@/utils/request'

// 购买方-新增-编辑
export function purchaserEdit(data) {
  return request({
    url: '/api/v1/config/purchaser/edit',
    method: 'post',
    data
  })
}
// 购买方列表(分页)
export function purchaserPage(data) {
  return request({
    url: '/api/v1/config/purchaser/page',
    method: 'post',
    data
  })
}
// 购买方-删除
export function purchaserDel(purchaserId) {
  return request({
    url: `/api/v1/config/purchaser/${purchaserId}`,
    method: 'DELETE'
  })
}
// 应用类型-新增-编辑
export function applicationTypeEdit(data) {
  return request({
    url: '/api/v1/config/applicationType/edit',
    method: 'post',
    data
  })
}
// 设备型号-新增-编辑
export function deviceModeledit(data) {
  return request({
    url: '/api/v1/config/deviceModel/edit',
    method: 'post',
    data
  })
}
// 购买方列表
export function purchaserList(data) {
  return request({
    url: '/api/v1/config/purchaser/list',
    method: 'GET',
    params: { data }
  })
}
// 应用类型列表
export function applicationTypeList(data) {
  return request({
    url: '/api/v1/config/applicationType/list',
    method: 'GET',
    params: { data }
  })
}
// 设备型号列表
export function deviceModelList(data) {
  return request({
    url: '/api/v1/config/deviceModel/list',
    method: 'GET',
    params: { data }
  })
}
// 应用类型列表(分页)
export function applicationTypePage(data) {
  return request({
    url: '/api/v1/config/applicationType/page',
    method: 'post',
    data
  })
}
// 设备型号列表(分页)
export function deviceModelPage(data) {
  return request({
    url: '/api/v1/config/deviceModel/page',
    method: 'post',
    data
  })
}
// 设备型号-删除
export function deviceModelDel(deviceModelId) {
  return request({
    url: `/api/v1/config/deviceModel/${deviceModelId}`,
    method: 'DELETE'
  })
}
// 应用类型-删除
export function applicationTypeDel(applicationTypeId) {
  return request({
    url: `/api/v1/config/applicationType/${applicationTypeId}`,
    method: 'DELETE'
  })
}
// --------------ampe-------------
// ampe-新增-编辑
export function ampeEdit(data) {
  return request({
    url: '/api/v1/iot/device/config/ampe/edit',
    method: 'post',
    data
  })
}
// ampe列表
export function ampeList(data) {
  return request({
    url: '/api/v1/iot/device/config/ampe/list',
    method: 'get',
    params: { data }
  })
}
// ampe列表(分页)
export function ampePage(data) {
  return request({
    url: '/api/v1/iot/device/config/ampe/page',
    method: 'post',
    data
  })
}
// ampe-删除
export function ampeDel(ampeId) {
  return request({
    url: `/api/v1/iot/device/config/ampe/${ampeId}`,
    method: 'DELETE'
  })
}
// ---------------iot模板----------
// iot模版-新增-编辑
export function templateEdit(data) {
  return request({
    url: '/api/v1/iot/device/config/template/edit',
    method: 'post',
    data
  })
}
// iot模版列表
export function templateList() {
  return request({
    url: '/api/v1/iot/device/config/template/list',
    method: 'get',
    params: {}
  })
}
// iot模版-模版详情
export function templateDetail(iotDeviceConfigTemplateId) {
  return request({
    url: '/api/v1/iot/device/config/template/detail',
    method: 'get',
    params: { iotDeviceConfigTemplateId }
  })
}
// iot模版列表(分页)
export function templatePage(data) {
  return request({
    url: '/api/v1/iot/device/config/template/page',
    method: 'post',
    data
  })
}
// iot模版-删除
export function templateDel(iotDeviceConfigTemplateId) {
  return request({
    url: `/api/v1/iot/device/config/template/${iotDeviceConfigTemplateId}`,
    method: 'DELETE'
  })
}
// ---------------容器配置----------
// 容器配置-添加-编辑
export function configAdd(data) {
  return request({
    url: '/api/v1/iot/device/config/add',
    method: 'post',
    data
  })
}
// 容器配置列表（分页）
export function configPage(data) {
  return request({
    url: '/api/v1/iot/device/config/page',
    method: 'post',
    data
  })
}
// 容器配置删除
export function configDel(iotDeviceConfigId) {
  return request({
    url: `/api/v1/iot/device/config/del/${iotDeviceConfigId}`,
    method: 'post'
  })
}
// 设备授权
export function configEmpower(iotDeviceConfigId) {
  return request({
    url: '/api/v1/iot/device/config/empower',
    method: 'get',
    params: { iotDeviceConfigId }
  })
}
// 设备取消授权
export function configCancelEmpower(iotDeviceConfigId) {
  return request({
    url: '/api/v1/iot/device/config/cancelEmpower',
    method: 'get',
    params: { iotDeviceConfigId }
  })
}
