passage.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package common
  2. // PassageRequest 统一的进出场请求(所有触发方式共用:RFID、摄像头、手动录入)
  3. type PassageRequest struct {
  4. RFIDTag string `json:"rfid_tag"` // RFID 标签(UHF 读卡器触发时)
  5. PlateNumber string `json:"plate_number"` // 车牌号(摄像头/手动触发时)
  6. DeviceCode string `json:"device_code"` // 设备编码(用于定位通道和控制道闸)
  7. Direction string `json:"direction"` // 双向通道必须明确 in/out
  8. Image string `json:"image"` // 抓拍图片路径
  9. ParkingLotID uint `json:"parking_lot_id"` // 人工入场选择的停车场
  10. SessionID uint `json:"session_id"`
  11. TicketNo string `json:"ticket_no"`
  12. PaymentEntry string `json:"payment_entry"`
  13. PaymentMethod string `json:"payment_method"`
  14. PaidAmount float64 `json:"paid_amount"`
  15. OperatorID uint `json:"-"`
  16. TriggerSource string `json:"trigger_source"`
  17. }
  18. // GateControlRequest 人工开关闸请求。
  19. type GateControlRequest struct {
  20. DeviceCode string `json:"device_code" binding:"required"`
  21. ValidTime byte `json:"valid_time"`
  22. Reason string `json:"reason"` // 人工抬杆/关闸原因(可选,用于异常留痕审计)
  23. PlateNumber string `json:"plate_number"` // 关联车牌(可选)
  24. SessionID uint `json:"session_id"` // 关联停车会话(可选)
  25. }
  26. // PassageResult 进出场结果
  27. type PassageResult struct {
  28. Success bool `json:"success"`
  29. Message string `json:"message"`
  30. SessionID uint `json:"session_id"`
  31. TicketID uint `json:"ticket_id"`
  32. TicketNo string `json:"ticket_no"`
  33. Direction string `json:"direction"` // in / out
  34. PlateNumber string `json:"plate_number"` // 车牌号
  35. RFIDTag string `json:"rfid_tag"` // RFID 标签
  36. Fee float64 `json:"fee"` // 出场费用(入场时为0)
  37. StayTime int64 `json:"stay_time"` // 停留时长(分钟)
  38. EntryTime int64 `json:"entry_time"` // 入场时间戳
  39. ExitTime int64 `json:"exit_time"` // 出场时间戳
  40. BusinessCompleted bool `json:"business_completed"`
  41. GateOpened bool `json:"gate_opened"`
  42. GateStatus string `json:"gate_status"`
  43. DeviceCode string `json:"device_code"`
  44. }