| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package entity
- import (
- "github.com/shopspring/decimal"
- "time"
- )
- // TgRedPacket Telegram红包表
- type TgRedPacket struct {
- MysqlBaseModel
- PacketNo string `json:"packetNo" gorm:"type:varchar(64);uniqueIndex;comment:红包编号(唯一);NOT NULL"`
- UserId int64 `json:"userId" gorm:"index;comment:发红包用户ID;NOT NULL"`
- GroupId string `json:"groupId" gorm:"type:varchar(128);index;comment:Telegram群组ID;NOT NULL"`
- PacketType int `json:"packetType" gorm:"type:tinyint;comment:红包类型: 1=普通红包, 2=手气红包;NOT NULL"`
- TotalAmount decimal.Decimal `json:"totalAmount" gorm:"type:decimal(25,8);comment:红包总金额;NOT NULL"`
- TotalCount int `json:"totalCount" gorm:"type:int;comment:红包总个数;NOT NULL"`
- GrabbedCount int `json:"grabbedCount" gorm:"type:int;default:0;comment:已抢个数"`
- GrabbedAmount decimal.Decimal `json:"grabbedAmount" gorm:"type:decimal(25,8);default:0;comment:已抢金额"`
- RemainCount int `json:"remainCount" gorm:"type:int;comment:剩余个数;NOT NULL"`
- RemainAmount decimal.Decimal `json:"remainAmount" gorm:"type:decimal(25,8);comment:剩余金额;NOT NULL"`
- Symbol string `json:"symbol" gorm:"type:varchar(20);default:'VND';comment:币种"`
- MaxGrabAmount decimal.Decimal `json:"maxGrabAmount" gorm:"type:decimal(25,8);default:0;comment:单人最大可领取金额(0=不限制)"`
- Lang string `json:"lang" gorm:"type:varchar(10);default:'vi';comment:消息语言: vi=越南语, id=印尼语, en=英语, zh=中文"`
- MessageId int64 `json:"messageId" gorm:"type:bigint;comment:Telegram消息ID"`
- BlessingWords string `json:"blessingWords" gorm:"type:varchar(255);comment:祝福语"`
- Status int `json:"status" gorm:"type:tinyint;default:1;index;comment:状态: 1=进行中, 2=已抢完, 3=已过期"`
- ExpireAt time.Time `json:"expireAt" gorm:"type:timestamp;comment:过期时间(24小时);NOT NULL"`
- CompletedAt *time.Time `json:"completedAt" gorm:"type:timestamp;comment:完成时间"`
- }
- func (*TgRedPacket) TableName() string {
- return ModelPrefix + "tg_red_packet"
- }
- func (*TgRedPacket) Comment() string {
- return "Telegram红包表"
- }
- func NewTgRedPacket() *TgRedPacket {
- return &TgRedPacket{}
- }
|