parking_lot.go 2.1 KB

123456789101112131415161718192021222324
  1. package dao
  2. import "wails-app/internal/global"
  3. // ParkingLot 停车区域
  4. type ParkingLot struct {
  5. global.GVA_MODEL
  6. LotCode string `gorm:"size:50;not null;uniqueIndex" json:"lot_code"` // 区域编码
  7. LotName string `gorm:"size:100;not null" json:"lot_name"` // 区域名称
  8. Capacity int `gorm:"not null" json:"capacity"` // 车位数量
  9. Occupied int `gorm:"not null;default:0" json:"occupied"` // 当前占用车位
  10. Available int `gorm:"not null" json:"available"` // 可用车位
  11. AllowTemporaryWhenFull bool `gorm:"column:allow_temporary_when_full;not null;default:false" json:"allow_temporary_when_full"` // 满位时允许临时车入场
  12. AllowMonthlyWhenFull bool `gorm:"column:allow_monthly_when_full;not null;default:true" json:"allow_monthly_when_full"` // 满位时允许有效月租车入场
  13. AllowVIPWhenFull bool `gorm:"column:allow_vip_when_full;not null;default:true" json:"allow_vip_when_full"` // 满位时允许有效 VIP 车入场
  14. Description string `gorm:"size:200" json:"description"` // 备注
  15. Booths []Booth `gorm:"foreignKey:ParkingLotID" json:"booths"` // 岗亭列表(一对多)
  16. Channels []Channel `gorm:"foreignKey:ParkingLotID" json:"channels"` // 通道列表(一对多)
  17. UHFReaders []UHFReader `gorm:"foreignKey:ParkingLotID" json:"uhf_readers"` // UHF读写器列表(一对多)
  18. }
  19. func (ParkingLot) TableName() string {
  20. return "parking_lot"
  21. }