vehicle.go 1009 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "server/global"
  4. "time"
  5. )
  6. type Vehicle struct {
  7. global.GVA_MODEL
  8. PlateNumber string `gorm:"size:20;not null;uniqueIndex" json:"plate_number"` // 车牌号
  9. VehicleType string `gorm:"size:20;not null" json:"vehicle_type"` // 车辆类型
  10. VehicleBrand string `gorm:"size:50" json:"vehicle_brand"` // 车辆品牌
  11. VehicleColor string `gorm:"size:20" json:"vehicle_color"` // 车辆颜色
  12. OwnerId *uint `json:"owner_id"` // 车主id,可为空(临时车辆)
  13. Owner *Owner `gorm:"foreignKey:OwnerId" json:"owner"`
  14. LastEntryTime time.Time `json:"last_entry_time"` // 最近入场时间
  15. LastExitTime time.Time `json:"last_exit_time"` // 最近出场时间
  16. TotalStayTime int64 `json:"total_stay_time"` // 总停留时间
  17. TotalFee float64 `json:"total_fee"` // 总费用
  18. }
  19. func (Vehicle) TableName() string {
  20. return "vehicle"
  21. }