diff --git a/server/wheelserver/api/v1/activity/activity.go b/server/wheelserver/api/v1/activity/activity.go index fc1b2552..d23c62f6 100644 --- a/server/wheelserver/api/v1/activity/activity.go +++ b/server/wheelserver/api/v1/activity/activity.go @@ -2,13 +2,14 @@ package activity import ( "f5" - "main/constant" "main/common" - "main/vo" + "main/constant" "main/model" - "math/rand" "main/mt" "main/service" + "main/vo" + "math/rand" + "github.com/gin-gonic/gin" ) @@ -40,7 +41,7 @@ func (this *ActivityApi) RollDice(c *gin.Context) { f5.RspErr(c, 500, "server internal error2") return } - if user.Dice <= 0 { + if reqJson.ForwardPoint == 0 && user.Dice <= 0 { f5.RspErr(c, 1, "dice not enough") return } @@ -63,11 +64,11 @@ func (this *ActivityApi) RollDice(c *gin.Context) { f5.RspErr(c, 500, "server internal error5") return } - } - if err := user.DecDice(1); err != nil { + } else if err := user.DecDice(1); err != nil { f5.RspErr(c, 500, "server internal error5") return } + if err := user.AddScore(score); err != nil { f5.RspErr(c, 500, "server internal error6") return