89 lines
4.9 KiB
Go
89 lines
4.9 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// WheelConfig stores the resident activity wheel master configuration.
|
|
type WheelConfig struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;uniqueIndex:uk_wheel_config_sys_origin"`
|
|
Enabled bool `gorm:"column:enabled"`
|
|
Timezone string `gorm:"column:timezone;size:64"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
// TableName returns the wheel master configuration table name.
|
|
func (WheelConfig) TableName() string { return "wheel_config" }
|
|
|
|
// WheelPoolConfig stores category-level wheel prices and switches.
|
|
type WheelPoolConfig struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
ConfigID int64 `gorm:"column:config_id;uniqueIndex:uk_wheel_pool_config,priority:1;index:idx_wheel_pool_config,priority:1"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;index:idx_wheel_pool_sys_origin,priority:1"`
|
|
Category string `gorm:"column:category;size:32;uniqueIndex:uk_wheel_pool_config,priority:2;index:idx_wheel_pool_sys_origin,priority:2"`
|
|
Enabled bool `gorm:"column:enabled"`
|
|
PriceOneGold int64 `gorm:"column:price_one_gold"`
|
|
PriceTenGold int64 `gorm:"column:price_ten_gold"`
|
|
PriceFiftyGold int64 `gorm:"column:price_fifty_gold"`
|
|
Sort int `gorm:"column:sort"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
// TableName returns the wheel pool configuration table name.
|
|
func (WheelPoolConfig) TableName() string { return "wheel_pool_config" }
|
|
|
|
// WheelRewardConfig stores one reward option on the wheel.
|
|
type WheelRewardConfig struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
ConfigID int64 `gorm:"column:config_id;index:idx_wheel_reward_config,priority:1"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;index:idx_wheel_reward_enabled,priority:1"`
|
|
Category string `gorm:"column:category;size:32;index:idx_wheel_reward_config,priority:2;index:idx_wheel_reward_enabled,priority:2"`
|
|
RewardType string `gorm:"column:reward_type;size:32"`
|
|
ResourceID *int64 `gorm:"column:resource_id"`
|
|
ResourceType string `gorm:"column:resource_type;size:64"`
|
|
ResourceName string `gorm:"column:resource_name;size:255"`
|
|
ResourceURL string `gorm:"column:resource_url;size:512"`
|
|
CoverURL string `gorm:"column:cover_url;size:512"`
|
|
DurationDays int `gorm:"column:duration_days"`
|
|
DisplayGoldAmount int64 `gorm:"column:display_gold_amount"`
|
|
GoldAmount int64 `gorm:"column:gold_amount"`
|
|
Probability int `gorm:"column:probability"`
|
|
Sort int `gorm:"column:sort"`
|
|
Enabled bool `gorm:"column:enabled;index:idx_wheel_reward_enabled,priority:3"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
// TableName returns the wheel reward configuration table name.
|
|
func (WheelRewardConfig) TableName() string { return "wheel_reward_config" }
|
|
|
|
// WheelDrawRecord stores each reward item produced by a wheel draw.
|
|
type WheelDrawRecord struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
DrawNo string `gorm:"column:draw_no;size:64;index:idx_wheel_draw_record_draw_no"`
|
|
EventID string `gorm:"column:event_id;size:128;uniqueIndex:uk_wheel_draw_record_event"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;index:idx_wheel_draw_record_user_time,priority:1"`
|
|
Category string `gorm:"column:category;size:32;index:idx_wheel_draw_record_category"`
|
|
UserID int64 `gorm:"column:user_id;index:idx_wheel_draw_record_user_time,priority:2"`
|
|
DrawTimes int `gorm:"column:draw_times"`
|
|
PaidGold int64 `gorm:"column:paid_gold"`
|
|
RewardType string `gorm:"column:reward_type;size:32"`
|
|
ResourceID *int64 `gorm:"column:resource_id"`
|
|
ResourceType string `gorm:"column:resource_type;size:64"`
|
|
ResourceName string `gorm:"column:resource_name;size:255"`
|
|
ResourceURL string `gorm:"column:resource_url;size:512"`
|
|
CoverURL string `gorm:"column:cover_url;size:512"`
|
|
DurationDays int `gorm:"column:duration_days"`
|
|
DisplayGoldAmount int64 `gorm:"column:display_gold_amount"`
|
|
GoldAmount int64 `gorm:"column:gold_amount"`
|
|
Probability int `gorm:"column:probability"`
|
|
Status string `gorm:"column:status;size:32;index:idx_wheel_draw_record_status"`
|
|
ErrorMessage string `gorm:"column:error_message;size:1024"`
|
|
CreateTime time.Time `gorm:"column:create_time;index:idx_wheel_draw_record_user_time,priority:3"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
// TableName returns the wheel draw record table name.
|
|
func (WheelDrawRecord) TableName() string { return "wheel_draw_record" }
|