This commit is contained in:
yangduo 2025-05-17 17:37:47 +08:00
parent e2dfa60599
commit 4a05b43729

View File

@ -233,7 +233,7 @@ func (gca *GiftCodeApi) ListType(c *gin.Context) {
func (gca *GiftCodeApi) AddType(c *gin.Context) {
req := struct {
GameId int32 `binding:"required" json:"gameid"`
Limit int32 `binding:"required" json:"limit"`
Limit *int32 `binding:"required" json:"limit"`
Content string `binding:"required" json:"content"`
}{}
if err := c.ShouldBindJSON(&req); err != nil {
@ -267,7 +267,7 @@ func (gca *GiftCodeApi) AddType(c *gin.Context) {
p.GiftType = maxtype + 1
p.GameId = req.GameId
p.Content = req.Content
p.Limit = req.Limit
p.Limit = *req.Limit
if p.Limit > 1 {
p.Limit = 1
}