fix
This commit is contained in:
parent
e2dfa60599
commit
4a05b43729
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user