import request from '@/config/axios'

// 设备维修故障分类 VO
export interface RepairFaultCategoryVO {
  id: number // 主键ID
  categoryCode: string // 分类编码
  categoryName: string // 分类名称
  state: number // 状态
  sort: number // 排序
}

// 设备维修故障分类 API
export const RepairFaultCategoryApi = {
  // 查询设备维修故障分类分页
  getRepairFaultCategoryPage: async (params: any) => {
    return await request.get({ url: `/device/repair-fault-category/page`, params })
  },

  // 查询设备维修故障分类详情
  getRepairFaultCategory: async (id: number) => {
    return await request.get({ url: `/device/repair-fault-category/get?id=` + id })
  },

  // 新增设备维修故障分类
  createRepairFaultCategory: async (data: RepairFaultCategoryVO) => {
    return await request.post({ url: `/device/repair-fault-category/create`, data })
  },

  // 修改设备维修故障分类
  updateRepairFaultCategory: async (data: RepairFaultCategoryVO) => {
    return await request.put({ url: `/device/repair-fault-category/update`, data })
  },

  // 删除设备维修故障分类
  deleteRepairFaultCategory: async (id: number) => {
    return await request.delete({ url: `/device/repair-fault-category/delete?id=` + id })
  },

  // 导出设备维修故障分类 Excel
  exportRepairFaultCategory: async (params) => {
    return await request.download({ url: `/device/repair-fault-category/export-excel`, params })
  },
}
