import request from '@/config/axios'

// 故障知识库 VO
export interface IotInformationDbVO {
  id: number // 主键id
  deviceType: string // 设备分类
  failureInfluence: string // 故障影响
  failureSystem: string // 故障模块/影响
  description: string // 描述
  solutions: string // 解决办法
  remark: string // 备注
  processInstanceId: string // 流程实例id
  auditStatus: number // 审核状态
}

// 故障知识库 API
export const IotInformationDbApi = {
  // 查询故障知识库分页
  getIotInformationDbPage: async (params: any) => {
    return await request.get({ url: `/rq/iot-information-db/page`, params })
  },

  // 查询故障知识库详情
  getIotInformationDb: async (id: number) => {
    return await request.get({ url: `/rq/iot-information-db/get?id=` + id })
  },

  // 新增故障知识库
  createIotInformationDb: async (data: IotInformationDbVO) => {
    return await request.post({ url: `/rq/iot-information-db/create`, data })
  },

  // 修改故障知识库
  updateIotInformationDb: async (data: IotInformationDbVO) => {
    return await request.put({ url: `/rq/iot-information-db/update`, data })
  },

  // 删除故障知识库
  deleteIotInformationDb: async (id: number) => {
    return await request.delete({ url: `/rq/iot-information-db/delete?id=` + id })
  },

  // 导出故障知识库 Excel
  exportIotInformationDb: async (params) => {
    return await request.download({ url: `/rq/iot-information-db/export-excel`, params })
  },
}
