reader.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package request
  2. // UHFReaderCreate UHF读写器创建请求
  3. type UHFReaderCreate struct {
  4. DeviceCode string `json:"device_code"` // 设备编码
  5. DeviceName string `json:"device_name"` // 设备名称
  6. DeviceType string `json:"device_type"` // 设备类型
  7. ConnectType string `json:"connect_type"` // 连接类型 tcp/serial
  8. IPAddress string `json:"ip_address"` // IP地址
  9. Port int `json:"port"` // 端口
  10. COMPort string `json:"com_port"` // 串口名称
  11. BaudRate int `json:"baud_rate"` // 串口波特率
  12. IsActive bool `json:"is_active"` // 是否启用
  13. Description string `json:"description"` // 备注
  14. ChannelId int `json:"channel_id"` // 通道id
  15. }
  16. // UHFReaderUpdate UHF读写器更新请求
  17. type UHFReaderUpdate struct {
  18. ID uint `json:"id"` // 设备ID
  19. DeviceCode string `json:"device_code"` // 设备编码
  20. DeviceName string `json:"device_name"` // 设备名称
  21. DeviceType string `json:"device_type"` // 设备类型
  22. ConnectType string `json:"connect_type"` // 连接类型 tcp/serial
  23. IPAddress string `json:"ip_address"` // IP地址
  24. Port int `json:"port"` // 端口
  25. COMPort string `json:"com_port"` // 串口名称
  26. BaudRate int `json:"baud_rate"` // 串口波特率
  27. IsActive bool `json:"is_active"` // 是否启用
  28. Description string `json:"description"` // 备注
  29. ChannelId int `json:"channel_id"` // 通道id
  30. }
  31. // UHFReaderQuery UHF读写器查询请求
  32. type UHFReaderQuery struct {
  33. DeviceCode string `form:"device_code"` // 设备编码
  34. DeviceName string `form:"device_name"` // 设备名称
  35. ConnectType string `form:"connect_type"` // 连接类型
  36. IPAddress string `form:"ip_address"` // IP地址
  37. Status string `form:"status"` // 状态
  38. ParkingLotID uint `form:"parking_lot_id"` // 所属区域ID
  39. Page int `form:"page,default=1"` // 页码
  40. PageSize int `form:"page_size,default=10"` // 每页数量
  41. }
  42. // UHFReaderConnect UHF读写器连接请求
  43. type UHFReaderConnect struct {
  44. ID uint `json:"id"` // 设备ID
  45. }
  46. // UHFReaderDisconnect UHF读写器断开连接请求
  47. type UHFReaderDisconnect struct {
  48. ID uint `json:"id"` // 设备ID
  49. }
  50. // UHFReaderPower UHF读写器功率设置请求
  51. type UHFReaderPower struct {
  52. ID uint `json:"id"` // 设备ID
  53. Power byte `json:"power" binding:"required,min=0,max=26"` // 功率值 0-26dBm
  54. }
  55. // UHFReaderTagReport UHF读写器标签上报请求
  56. type UHFReaderTagReport struct {
  57. DeviceCode string `json:"device_code" binding:"required"` // 设备编码
  58. Tag string `json:"tag" binding:"required"` // 标签UII
  59. }