🎨 新增兑换码功能,新增vip过期检测定时任务
This commit is contained in:
34
model/app/redeem_code.go
Normal file
34
model/app/redeem_code.go
Normal file
@@ -0,0 +1,34 @@
|
||||
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"
|
||||
}
|
||||
23
model/app/request/cdk.go
Normal file
23
model/app/request/cdk.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package request
|
||||
|
||||
import common "git.echol.cn/loser/lckt/model/common/request"
|
||||
|
||||
type GenerateCDK struct {
|
||||
Eid uint `json:"eid" form:"eid" binding:"required"` // 兑换码库ID
|
||||
Number int `json:"number" from:"number" binding:"required,min=1"` // 生成数量
|
||||
Expirer int `json:"expirer" form:"expirer"` // 有效期,单位天 0表示永久有效
|
||||
}
|
||||
|
||||
type GetCDKList struct {
|
||||
common.PageInfo
|
||||
Eid uint `json:"eid" form:"eid" binding:"required"`
|
||||
Code string `json:"code" form:"code"` // 兑换码
|
||||
UseName string `json:"useName" form:"useName"` // 使用人
|
||||
Status int `json:"status" form:"status"` // 状态
|
||||
}
|
||||
|
||||
type RedeemCDK struct {
|
||||
Code string `json:"code" form:"code" binding:"required"` // 兑换码
|
||||
UseName string `json:"useName" form:"useName"` // 使用人名称
|
||||
UserId uint `json:"userId" form:"userId"` // 用户ID
|
||||
}
|
||||
8
model/app/vo/cdk.go
Normal file
8
model/app/vo/cdk.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package vo
|
||||
|
||||
import "git.echol.cn/loser/lckt/model/app"
|
||||
|
||||
type CDKVo struct {
|
||||
Eid uint `json:"eid"` // 兑换码库ID
|
||||
CDK []app.CDK `json:"cdk"` // 生成的兑换码
|
||||
}
|
||||
Reference in New Issue
Block a user