import request from '@/config/axios'

// 采集点分类 VO
export interface DeviceAttributeTypeVO {
  id: number // ID
  code: string // 分类编码
  name: string // 分类名称
  sort: number // 分类顺序
  remark: string // 备注
}

// 采集点分类 API
export const DeviceAttributeTypeApi = {
  // 查询采集点分类分页
  getDeviceAttributeTypePage: async (params: any) => {
    return await request.get({ url: `/iot/device-attribute-type/page`, params })
  },

  // 查询采集点分类详情
  getDeviceAttributeType: async (id: number) => {
    return await request.get({ url: `/iot/device-attribute-type/get?id=` + id })
  },

  // 新增采集点分类
  createDeviceAttributeType: async (data: DeviceAttributeTypeVO) => {
    return await request.post({ url: `/iot/device-attribute-type/create`, data })
  },

  // 修改采集点分类
  updateDeviceAttributeType: async (data: DeviceAttributeTypeVO) => {
    return await request.put({ url: `/iot/device-attribute-type/update`, data })
  },

  // 删除采集点分类
  deleteDeviceAttributeType: async (ids: string) => {
    return await request.delete({ url: `/iot/device-attribute-type/delete?ids=` + ids })
  },

  // 导出采集点分类 Excel
  exportDeviceAttributeType: async (params) => {
    return await request.download({ url: `/iot/device-attribute-type/export-excel`, params })
  },

  // 获得采集点分类列表
  getDeviceAttributeTypeList: async () => {
    return await request.get({ url: `/iot/device-attribute-type/list` })
  },
}
