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