parking_lot.go 978 B

1234567891011121314151617181920
  1. package dao
  2. import "server/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. Available int `gorm:"not null" json:"available"` // 可用车位
  10. Description string `gorm:"size:200" json:"description"` // 备注
  11. Booths []Booth `gorm:"foreignKey:ParkingLotID" json:"booths"` // 岗亭列表(一对多)
  12. Channels []Channel `gorm:"foreignKey:ParkingLotID" json:"channels"` // 通道列表(一对多)
  13. UHFReaders []UHFReader `gorm:"foreignKey:ParkingLotID" json:"uhf_readers"` // UHF读写器列表(一对多)
  14. }
  15. func (ParkingLot) TableName() string {
  16. return "parking_lot"
  17. }