topfans/backend/pkg/models/gallery.go
zerosaturation c5bf9df955 feat: 经济系统重构 - 任务服务与画廊服务解耦
- galleryService 独立启动,配置 task-service-url
- 新增 taskService 到 galleryService 的 RPC 调用
- 更新 proto 文件并重新生成代码
- 新增展览唯一约束迁移脚本
- 修复多个 service 的配置和依赖关系

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 23:12:02 +08:00

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;index:idx_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"
}