import request from '@/config/axios'

// 光源 VO
export interface LightSourceVO {
  id: number // id
  streetId: number // 巷道id
  ip: string // ip
  port: string // 端口
  direction: number // 方向 
  info: string // 信息
  type: number // 类型
}

// 光源 API
export const LightSourceApi = {
  // 查询光源分页
  getLightSourcePage: async (params: any) => {
    return await request.get({ url: `/logistics/light-source/page`, params })
  },

  // 查询光源详情
  getLightSource: async (id: number) => {
    return await request.get({ url: `/logistics/light-source/get?id=` + id })
  },

  // 新增光源
  createLightSource: async (data: LightSourceVO) => {
    return await request.post({ url: `/logistics/light-source/create`, data })
  },

  // 修改光源
  updateLightSource: async (data: LightSourceVO) => {
    return await request.put({ url: `/logistics/light-source/update`, data })
  },

  // 删除光源
  deleteLightSource: async (id: number) => {
    return await request.delete({ url: `/logistics/light-source/delete?id=` + id })
  },




  
  // 导出光源 Excel
  exportLightSource: async (params) => {
    return await request.download({ url: `/logistics/light-source/export-excel`, params })
  },
}
