From c0e36c7c523b0a3f650cf1618b82ef02d74602df Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 11 Nov 2024 11:31:41 +0800 Subject: [PATCH] 1 --- database/wheeldb.sql | 2 +- server/wheelserver/api/v1/activity/activity.go | 3 ++- server/wheelserver/api/v1/user/user.go | 2 +- server/wheelserver/model/user.go | 2 +- server/wheelserver/vo/user.go | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/database/wheeldb.sql b/database/wheeldb.sql index 3e8c63a2..f19db329 100644 --- a/database/wheeldb.sql +++ b/database/wheeldb.sql @@ -59,7 +59,7 @@ CREATE TABLE `t_user` ( `account_id` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'accountid', `avatar` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'avatar', `nickname` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'nickname', - `score` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'score', + `score` bigint(11) NOT NULL DEFAULT '0' COMMENT 'score', `dice` int(11) NOT NULL DEFAULT '0' COMMENT '骰子数', `last_present_dice_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后赠送骰子时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', diff --git a/server/wheelserver/api/v1/activity/activity.go b/server/wheelserver/api/v1/activity/activity.go index 0758cabd..31253750 100644 --- a/server/wheelserver/api/v1/activity/activity.go +++ b/server/wheelserver/api/v1/activity/activity.go @@ -31,7 +31,8 @@ func (this *ActivityApi) RollDice(c *gin.Context) { return } if err := user.DecDice(1); err != nil { - + f5.RspErr(c, 500, "server internal error") + return } rspObj := struct { vo.BaseVo diff --git a/server/wheelserver/api/v1/user/user.go b/server/wheelserver/api/v1/user/user.go index 5c54390e..aecb007b 100644 --- a/server/wheelserver/api/v1/user/user.go +++ b/server/wheelserver/api/v1/user/user.go @@ -32,7 +32,7 @@ func (this *UserApi) Login(c *gin.Context) { user.AccountId = s.GetAccountId() user.Avatar = "" user.NickName = s.GetNickName() - user.Score = "" + user.Score = 0 user.Dice = mt.Table.Global.GetDailyDiceNum() user.LastPresentDiceTime = q5.ToInt32(nowTime) user.CreateTime = q5.ToInt32(nowTime) diff --git a/server/wheelserver/model/user.go b/server/wheelserver/model/user.go index 46995f52..2e298628 100644 --- a/server/wheelserver/model/user.go +++ b/server/wheelserver/model/user.go @@ -14,7 +14,7 @@ type User struct { AccountId string `gorm:"column:account_id;primaryKey"` Avatar string `gorm:"column:avatar"` NickName string `gorm:"column:nickname"` - Score string `gorm:"column:score"` + Score int64 `gorm:"column:score"` Dice int32 `gorm:"column:dice"` LastPresentDiceTime int32 `gorm:"column:last_present_dice_time"` CreateTime int32 `gorm:"column:createtime;<-:create"` diff --git a/server/wheelserver/vo/user.go b/server/wheelserver/vo/user.go index ae3b62dd..0997b19d 100644 --- a/server/wheelserver/vo/user.go +++ b/server/wheelserver/vo/user.go @@ -8,7 +8,7 @@ type User struct { AccountId string `json:"account_id"` NickName string `json:"nickname"` Avatar string `json:"avatar"` - Score string `json:"score"` + Score int64 `json:"score"` HourlyEarnings string `json:"hourly_earnings"` Dice int32 `json:"dice"` }