2025-05-07 15:03:19 +08:00

23 lines
407 B
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 entity
import (
"admin/apps/game/model"
"admin/lib/cdkey"
)
var MaxKeyNum = 100000 // 每个批次直接搞10w个不然运营想补加码算法又要一开始定好数量
type CDKey struct {
Po *model.CDKey
}
func NewCDKey(po *model.CDKey) *CDKey {
return &CDKey{
Po: po,
}
}
func (c *CDKey) GenerateKeys() []string {
return cdkey.GenerateAll(c.Po.ID, MaxKeyNum)[:c.Po.CodeNum]
}