import request from '@/config/axios'

// 物联看板 VO
export interface KanbanVO {
  id: number // ID
  img: string // 缩略图
  remark: string // 备注
  isEnable: boolean // 是否启用
  code: string // 编码
  title: string // 标题
  viewUrl: string // 访问地址
  tags: string // 标签
}

// 物联看板 API
export const KanbanApi = {
  // 查询物联看板分页
  getKanbanPage: async (params: any) => {
    return await request.get({ url: `/iot/kanban/page`, params })
  },

  // 查询物联看板详情
  getKanban: async (id: number) => {
    return await request.get({ url: `/iot/kanban/get?id=` + id })
  },

  // 新增物联看板
  createKanban: async (data: KanbanVO) => {
    return await request.post({ url: `/iot/kanban/create`, data })
  },

  // 修改物联看板
  updateKanban: async (data: KanbanVO) => {
    return await request.put({ url: `/iot/kanban/update`, data })
  },

  // 删除物联看板
  deleteKanban: async (id: number) => {
    return await request.delete({ url: `/iot/kanban/delete?id=` + id })
  },

  // 导出物联看板 Excel
  exportKanban: async (params) => {
    return await request.download({ url: `/iot/kanban/export-excel`, params })
  },
}
