import request from '@/config/axios'

// 扫码枪 VO
export interface SensorGunVO {
  id: number // id
  streetId: number // 巷道id
  direction: number // 左右
  ip: string // ip
  port: number // 端口
}

// 扫码枪 API
export const SensorGunApi = {
  // 查询扫码枪分页
  getSensorGunPage: async (params: any) => {
    return await request.get({ url: `/logistics/sensor-gun/page`, params })
  },

  // 查询扫码枪详情
  getSensorGun: async (id: number) => {
    return await request.get({ url: `/logistics/sensor-gun/get?id=` + id })
  },

  // 新增扫码枪
  createSensorGun: async (data: SensorGunVO) => {
    return await request.post({ url: `/logistics/sensor-gun/create`, data })
  },

  // 修改扫码枪
  updateSensorGun: async (data: SensorGunVO) => {
    return await request.put({ url: `/logistics/sensor-gun/update`, data })
  },

  // 删除扫码枪
  deleteSensorGun: async (id: number) => {
    return await request.delete({ url: `/logistics/sensor-gun/delete?id=` + id })
  },

  // 导出扫码枪 Excel
  exportSensorGun: async (params) => {
    return await request.download({ url: `/logistics/sensor-gun/export-excel`, params })
  },
}
