1
This commit is contained in:
parent
ee316fccea
commit
3a89491530
@ -6,6 +6,7 @@ import (
|
||||
"main/common"
|
||||
"main/vo"
|
||||
"main/model"
|
||||
"math/rand"
|
||||
"main/mt"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@ -45,10 +46,15 @@ func (this *ActivityApi) RollDice(c *gin.Context) {
|
||||
f5.RspErr(c, 500, "server internal error5")
|
||||
return
|
||||
}
|
||||
if err := user.AddScore(score); err != nil {
|
||||
f5.RspErr(c, 500, "server internal error6")
|
||||
return
|
||||
}
|
||||
rspObj := struct {
|
||||
vo.BaseVo
|
||||
Point int32 `json:"point"`
|
||||
}{}
|
||||
rspObj.Point = int32(1 + rand.Intn(6))
|
||||
rspObj.SideEffect = new(vo.SideEffect)
|
||||
rspObj.SideEffect.User = new(vo.User)
|
||||
rspObj.SideEffect.User.FromModel(user)
|
||||
|
Loading…
x
Reference in New Issue
Block a user