From 82162d6d3a419834e1c8f6fc7e55e731c0bd166e Mon Sep 17 00:00:00 2001 From: yangduo Date: Wed, 4 Dec 2024 22:17:45 +0800 Subject: [PATCH] fix --- server/wheelserver/api/v1/activity/activity.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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