import request from '@/config/axios'

// RFID VO
export interface RfidVO {
  id: number // id
  streetId: number // 巷道id
  direction: number // 方向
  ip: string // ip
  port: number // 端口
}

// RFID API
export const RfidApi = {
  // 查询RFID分页
  getRfidPage: async (params: any) => {
    return await request.get({ url: `/logistics/rfid/page`, params })
  },
  // 查询RFID详情
  getRfid: async (id: number) => {
    return await request.get({ url: `/logistics/rfid/get?id=` + id })
  },

  // 新增RFID
  createRfid: async (data: RfidVO) => {
    return await request.post({ url: `/logistics/rfid/create`, data })
  },

  // 修改RFID
  updateRfid: async (data: RfidVO) => {
    return await request.put({ url: `/logistics/rfid/update`, data })
  },

  // 删除RFID
  deleteRfid: async (id: number) => {
    return await request.delete({ url: `/logistics/rfid/delete?id=` + id })
  },

  // 导出RFID Excel
  exportRfid: async (params) => {
    return await request.download({ url: `/logistics/rfid/export-excel`, params })
  },
}
