42 lines
1.8 KiB
Go
42 lines
1.8 KiB
Go
package models
|
|
|
|
// BoothSlot 展位表
|
|
type BoothSlot struct {
|
|
SlotID int64 `gorm:"primaryKey;column:slot_id;autoIncrement"`
|
|
HostProfileID int64 `gorm:"column:host_profile_id;not null;index:idx_host_slot,unique"`
|
|
UserID int64 `gorm:"column:user_id;not null;index:idx_user_star"`
|
|
StarID int64 `gorm:"column:star_id;not null;index:idx_user_star;index:idx_star_enabled"`
|
|
SlotIndex int `gorm:"column:slot_index;not null;index:idx_host_slot,unique"`
|
|
Visibility string `gorm:"column:visibility;default:'public';type:varchar(20)"`
|
|
IsEnabled bool `gorm:"column:is_enabled;default:false"`
|
|
UnlockType string `gorm:"column:unlock_type;type:varchar(20)"`
|
|
UnlockValue int `gorm:"column:unlock_value"`
|
|
CreatedAt int64 `gorm:"column:created_at;not null"`
|
|
UpdatedAt int64 `gorm:"column:updated_at;not null"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (BoothSlot) TableName() string {
|
|
return "booth_slots"
|
|
}
|
|
|
|
// Exhibition 展品展示表
|
|
type Exhibition struct {
|
|
ID int64 `gorm:"primaryKey;column:id;autoIncrement"`
|
|
AssetID int64 `gorm:"column:asset_id;not null;uniqueIndex:uk_asset"`
|
|
SlotID int64 `gorm:"column:slot_id;not null;index:idx_slot"`
|
|
HostProfileID int64 `gorm:"column:host_profile_id;not null;index:idx_host"`
|
|
OccupierUID int64 `gorm:"column:occupier_uid;not null;index:idx_occupier"`
|
|
OccupierStarID int64 `gorm:"column:occupier_star_id;not null;index:idx_occupier"`
|
|
StartTime int64 `gorm:"column:start_time;not null"`
|
|
ExpireAt int64 `gorm:"column:expire_at;not null;index:idx_expire"`
|
|
CreatedAt int64 `gorm:"column:created_at;not null"`
|
|
UpdatedAt int64 `gorm:"column:updated_at;not null"`
|
|
DeletedAt *int64 `gorm:"column:deleted_at"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (Exhibition) TableName() string {
|
|
return "exhibitions"
|
|
}
|