1
This commit is contained in:
parent
a207fb292a
commit
1b6f7dbba1
@ -1,13 +1,13 @@
|
|||||||
package gm
|
package gm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"q5"
|
//"q5"
|
||||||
"f5"
|
"f5"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
"main/common"
|
"main/common"
|
||||||
"main/model"
|
//"main/model"
|
||||||
"main/vo"
|
"main/vo"
|
||||||
"main/mt"
|
//"main/mt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -26,34 +26,8 @@ func (this *GmApi) ExecCmd(c *gin.Context) {
|
|||||||
f5.RspErr(c, 401, "params parse error")
|
f5.RspErr(c, 401, "params parse error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user := new(model.User)
|
|
||||||
rspObj := struct {
|
rspObj := struct {
|
||||||
vo.BaseVo
|
vo.BaseVo
|
||||||
UserInfo vo.User `json:"user_info"`
|
|
||||||
}{}
|
}{}
|
||||||
nowTime := f5.GetApp().GetRealSeconds()
|
|
||||||
if err, found := user.Find(s.GetAccountId(), nowTime); err != nil {
|
|
||||||
f5.RspErr(c, 500, "server internal error")
|
|
||||||
return
|
|
||||||
} else if !found {
|
|
||||||
user.AccountId = s.GetAccountId()
|
|
||||||
user.Avatar = ""
|
|
||||||
user.NickName = s.GetNickName()
|
|
||||||
user.Score = 0
|
|
||||||
user.Dice = mt.Table.Global.GetDailyDiceNum()
|
|
||||||
user.LastPresentDiceTime = q5.ToInt32(nowTime)
|
|
||||||
user.CreateTime = q5.ToInt32(nowTime)
|
|
||||||
user.ModifyTime = q5.ToInt32(nowTime)
|
|
||||||
if user.Create() != nil {
|
|
||||||
f5.RspErr(c, 500, "server internal error")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
f5.GetMsgQueue().FireEvent(constant.MSG_CREATE_USER, q5.Args{user})
|
|
||||||
}
|
|
||||||
if user.NickName != s.GetNickName() {
|
|
||||||
user.UpdateName()
|
|
||||||
}
|
|
||||||
f5.GetMsgQueue().FireEvent(constant.MSG_LOGIN, q5.Args{user})
|
|
||||||
rspObj.UserInfo.FromModel(user)
|
|
||||||
c.JSON(200, rspObj)
|
c.JSON(200, rspObj)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user