Files
lckt-server/model/app/redeem_code.go

35 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"
}