package model import "time" // VipLevelConfig stores the operator-managed 30-day VIP level configuration. type VipLevelConfig struct { ID int64 `gorm:"column:id;primaryKey"` SysOrigin string `gorm:"column:sys_origin;size:32;uniqueIndex:uk_vip_level_config,priority:1;index:idx_vip_level_config_sys_origin,priority:1"` Level int `gorm:"column:level;uniqueIndex:uk_vip_level_config,priority:2"` LevelCode string `gorm:"column:level_code;size:16"` DisplayName string `gorm:"column:display_name;size:64"` Enabled bool `gorm:"column:enabled"` DurationDays int `gorm:"column:duration_days"` PriceGold int64 `gorm:"column:price_gold"` BadgeResourceID int64 `gorm:"column:badge_resource_id"` BadgeName string `gorm:"column:badge_name;size:128"` BadgeURL string `gorm:"column:badge_url;size:512"` AvatarFrameResourceID int64 `gorm:"column:avatar_frame_resource_id"` AvatarFrameName string `gorm:"column:avatar_frame_name;size:128"` AvatarFrameURL string `gorm:"column:avatar_frame_url;size:512"` EntryEffectResourceID int64 `gorm:"column:entry_effect_resource_id"` EntryEffectName string `gorm:"column:entry_effect_name;size:128"` EntryEffectURL string `gorm:"column:entry_effect_url;size:512"` ChatBubbleResourceID int64 `gorm:"column:chat_bubble_resource_id"` ChatBubbleName string `gorm:"column:chat_bubble_name;size:128"` ChatBubbleURL string `gorm:"column:chat_bubble_url;size:512"` FloatPictureResourceID int64 `gorm:"column:float_picture_resource_id"` FloatPictureName string `gorm:"column:float_picture_name;size:128"` FloatPictureURL string `gorm:"column:float_picture_url;size:512"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` } // TableName returns the VIP level config table name. func (VipLevelConfig) TableName() string { return "vip_level_config" } // UserVipState stores the single active VIP state for a user. type UserVipState struct { ID int64 `gorm:"column:id;primaryKey"` SysOrigin string `gorm:"column:sys_origin;size:32;uniqueIndex:uk_user_vip_state,priority:1;index:idx_user_vip_state_lookup,priority:1"` UserID int64 `gorm:"column:user_id;uniqueIndex:uk_user_vip_state,priority:2;index:idx_user_vip_state_lookup,priority:2"` Level int `gorm:"column:level"` LevelCode string `gorm:"column:level_code;size:16"` DisplayName string `gorm:"column:display_name;size:64"` Status string `gorm:"column:status;size:32;index:idx_user_vip_state_lookup,priority:3"` StartAt time.Time `gorm:"column:start_at"` ExpireAt time.Time `gorm:"column:expire_at;index:idx_user_vip_expire"` BadgeResourceID int64 `gorm:"column:badge_resource_id"` BadgeName string `gorm:"column:badge_name;size:128"` BadgeURL string `gorm:"column:badge_url;size:512"` AvatarFrameResourceID int64 `gorm:"column:avatar_frame_resource_id"` AvatarFrameName string `gorm:"column:avatar_frame_name;size:128"` AvatarFrameURL string `gorm:"column:avatar_frame_url;size:512"` EntryEffectResourceID int64 `gorm:"column:entry_effect_resource_id"` EntryEffectName string `gorm:"column:entry_effect_name;size:128"` EntryEffectURL string `gorm:"column:entry_effect_url;size:512"` ChatBubbleResourceID int64 `gorm:"column:chat_bubble_resource_id"` ChatBubbleName string `gorm:"column:chat_bubble_name;size:128"` ChatBubbleURL string `gorm:"column:chat_bubble_url;size:512"` FloatPictureResourceID int64 `gorm:"column:float_picture_resource_id"` FloatPictureName string `gorm:"column:float_picture_name;size:128"` FloatPictureURL string `gorm:"column:float_picture_url;size:512"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` } // TableName returns the user VIP state table name. func (UserVipState) TableName() string { return "user_vip_state" } // VipOrderRecord stores VIP purchase, renew, and upgrade records. type VipOrderRecord struct { ID int64 `gorm:"column:id;primaryKey"` EventID string `gorm:"column:event_id;size:128;uniqueIndex:uk_vip_order_event"` SysOrigin string `gorm:"column:sys_origin;size:32;index:idx_vip_order_user_time,priority:1"` UserID int64 `gorm:"column:user_id;index:idx_vip_order_user_time,priority:2"` OrderType string `gorm:"column:order_type;size:32"` FromLevel int `gorm:"column:from_level"` ToLevel int `gorm:"column:to_level"` DurationDays int `gorm:"column:duration_days"` OriginalPriceGold int64 `gorm:"column:original_price_gold"` PaidGold int64 `gorm:"column:paid_gold"` Status string `gorm:"column:status;size:32;index:idx_vip_order_status"` StartAt time.Time `gorm:"column:start_at"` ExpireAt time.Time `gorm:"column:expire_at"` ErrorMessage string `gorm:"column:error_message;size:512"` CreateTime time.Time `gorm:"column:create_time;index:idx_vip_order_user_time,priority:3"` UpdateTime time.Time `gorm:"column:update_time"` } // TableName returns the VIP order table name. func (VipOrderRecord) TableName() string { return "vip_order_record" }