package app import "git.echol.cn/loser/lckt/global" type RedeemCode struct { global.GVA_MODEL CodeName string `json:"codeName" gorm:"comment:兑换码名称"` Type int `json:"type" gorm:"comment:类型,1-VIP,2-讲师VIP,3-课程"` Item uint `json:"item" gorm:"comment:对应类型的ID"` Num int `json:"num" gorm:"comment:兑换码数量"` No int `json:"no" gorm:"comment:已使用数量"` } func (RedeemCode) TableName() string { return "app_redeem_code" } type CDK struct { global.GVA_MODEL RedeemId uint `json:"redeemId" gorm:"comment:兑换码库ID"` Code string `json:"code" gorm:"unique;comment:兑换码"` Status int `json:"status" gorm:"default:1;comment:状态,1-未使用,2-已使用,3-已过期"` UseId uint `json:"useId" gorm:"comment:使用用户ID"` UseName string `json:"useName" gorm:"comment:使用用户名"` UseAt string `json:"useAt" gorm:"comment:使用时间"` // 有效期 ValidDay int `json:"validDay" gorm:"comment:有效期,单位天 0表示永久有效"` // 过期时间 ExpireAt string `json:"expireAt" gorm:"comment:过期时间"` } func (CDK) TableName() string { return "app_cdk" }