| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package common
- // PassageRequest 统一的进出场请求(所有触发方式共用:RFID、摄像头、手动录入)
- type PassageRequest struct {
- RFIDTag string `json:"rfid_tag"` // RFID 标签(UHF 读卡器触发时)
- PlateNumber string `json:"plate_number"` // 车牌号(摄像头/手动触发时)
- DeviceCode string `json:"device_code"` // 设备编码(用于定位通道和控制道闸)
- Direction string `json:"direction"` // 双向通道必须明确 in/out
- Image string `json:"image"` // 抓拍图片路径
- ParkingLotID uint `json:"parking_lot_id"` // 人工入场选择的停车场
- SessionID uint `json:"session_id"`
- TicketNo string `json:"ticket_no"`
- PaymentEntry string `json:"payment_entry"`
- PaymentMethod string `json:"payment_method"`
- PaidAmount float64 `json:"paid_amount"`
- OperatorID uint `json:"-"`
- TriggerSource string `json:"trigger_source"`
- }
- // GateControlRequest 人工开关闸请求。
- type GateControlRequest struct {
- DeviceCode string `json:"device_code" binding:"required"`
- ValidTime byte `json:"valid_time"`
- Reason string `json:"reason"` // 人工抬杆/关闸原因(可选,用于异常留痕审计)
- PlateNumber string `json:"plate_number"` // 关联车牌(可选)
- SessionID uint `json:"session_id"` // 关联停车会话(可选)
- }
- // PassageResult 进出场结果
- type PassageResult struct {
- Success bool `json:"success"`
- Message string `json:"message"`
- SessionID uint `json:"session_id"`
- TicketID uint `json:"ticket_id"`
- TicketNo string `json:"ticket_no"`
- Direction string `json:"direction"` // in / out
- PlateNumber string `json:"plate_number"` // 车牌号
- RFIDTag string `json:"rfid_tag"` // RFID 标签
- Fee float64 `json:"fee"` // 出场费用(入场时为0)
- StayTime int64 `json:"stay_time"` // 停留时长(分钟)
- EntryTime int64 `json:"entry_time"` // 入场时间戳
- ExitTime int64 `json:"exit_time"` // 出场时间戳
- BusinessCompleted bool `json:"business_completed"`
- GateOpened bool `json:"gate_opened"`
- GateStatus string `json:"gate_status"`
- DeviceCode string `json:"device_code"`
- }
|