yumi-golang/internal/model/luckygift_models.go

50 lines
4.9 KiB
Go

package model
import "time"
// LuckyGiftDrawRequestRecord 保存幸运礼物抽奖主请求及其处理状态。
type LuckyGiftDrawRequestRecord struct {
ID int64 `gorm:"column:id;primaryKey"` // 抽奖请求主键
BusinessID string `gorm:"column:business_id;size:64;uniqueIndex:uk_lucky_gift_business"` // 业务幂等 ID
ConsumeAssetRecordID string `gorm:"column:consume_asset_record_id;size:64"` // 消耗资产记录 ID
SysOrigin string `gorm:"column:sys_origin;size:32;index:idx_lucky_gift_sender,priority:1"` // 系统标识
StandardID int64 `gorm:"column:standard_id"` // 配置档位 ID
RoomID int64 `gorm:"column:room_id"` // 房间 ID
SendUserID int64 `gorm:"column:send_user_id;index:idx_lucky_gift_sender,priority:2"` // 送礼用户 ID
GiftID int64 `gorm:"column:gift_id"` // 礼物 ID
GiftPrice int64 `gorm:"column:gift_price"` // 礼物单价
GiftNum int64 `gorm:"column:gift_num"` // 礼物数量
GiftIsFree bool `gorm:"column:gift_is_free"` // 是否免费礼物
ProviderCode int `gorm:"column:provider_code"` // 三方返回码
RewardTotal int64 `gorm:"column:reward_total"` // 总中奖金币
BalanceAfter int64 `gorm:"column:balance_after"` // 返奖后余额
WalletEventID string `gorm:"column:wallet_event_id;size:128;uniqueIndex:uk_lucky_gift_wallet_event"` // 钱包事件 ID
Status string `gorm:"column:status;size:32;index:idx_lucky_gift_status"` // 请求状态
ErrorMessage string `gorm:"column:error_message;size:1024"` // 错误信息
RequestJSON string `gorm:"column:request_json;type:longtext"` // 原始请求报文
ProviderResponseJSON string `gorm:"column:provider_response_json;type:longtext"` // 三方返回报文
ResponseJSON string `gorm:"column:response_json;type:longtext"` // 对外响应报文
CreateTime time.Time `gorm:"column:create_time"` // 创建时间
UpdateTime time.Time `gorm:"column:update_time"` // 更新时间
}
// TableName 返回幸运礼物抽奖请求表名。
func (LuckyGiftDrawRequestRecord) TableName() string { return "lucky_gift_draw_request" }
// LuckyGiftDrawOrderRecord 保存每个收礼人的抽奖结果明细。
type LuckyGiftDrawOrderRecord struct {
ID int64 `gorm:"column:id;primaryKey"` // 明细主键
BusinessID string `gorm:"column:business_id;size:64;uniqueIndex:uk_lucky_gift_order,priority:1;index:idx_lucky_gift_order_business"` // 业务幂等 ID
OrderSeed string `gorm:"column:order_seed;size:64;uniqueIndex:uk_lucky_gift_order,priority:2"` // 单条订单种子
SortNo int `gorm:"column:sort_no"` // 排序号
AcceptUserID int64 `gorm:"column:accept_user_id"` // 收礼用户 ID
ProviderOrderID string `gorm:"column:provider_order_id;size:64"` // 三方订单 ID
IsWin bool `gorm:"column:is_win"` // 是否中奖
RewardNum int64 `gorm:"column:reward_num"` // 中奖数量
CreateTime time.Time `gorm:"column:create_time"` // 创建时间
UpdateTime time.Time `gorm:"column:update_time"` // 更新时间
}
// TableName 返回幸运礼物抽奖明细表名。
func (LuckyGiftDrawOrderRecord) TableName() string { return "lucky_gift_draw_order" }