From f0fde152b7fb597210815757227e54635fb47049 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Tue, 14 Jul 2020 17:38:42 +0800 Subject: [PATCH] 提交 --- src/HttpServer/logic/constdef.go | 2 ++ src/HttpServer/logic/datadef.go | 3 +++ src/HttpServer/logic/function.go | 4 ++++ src/HttpServer/logic/logic.go | 6 ++++++ 4 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/HttpServer/logic/constdef.go b/src/HttpServer/logic/constdef.go index 5abab8c..35f3e52 100644 --- a/src/HttpServer/logic/constdef.go +++ b/src/HttpServer/logic/constdef.go @@ -11,6 +11,7 @@ const ( TASKTYPE_WATCHADSSURPRICE = 7 //领取惊喜红包 TASKTYPE_WATCHADSPAY = 8 //领取付费红包 TASKTYPE_WATCHADSTIME = 9 //领取时长红包 + TASKTYPE_SHAKETIME = 10 //摇一摇次数 ) @@ -61,6 +62,7 @@ const ( WATCH_ADD_DAY_LIMIT = 25 //当天获取红包次数限制 PAY_ADD_DAY_LIMIT = 20 //当天付费红包次数限制 TIME_ADD_DAY_LIMIT = 5 //当天时长红包次数限制 + SHAKELIMIT = 20 //摇一摇限制次数 FREE_REDBAG_NUM = 3 //玩家免费红包次数 READGOLDMULTI = 700 //阅读量到金币转化倍数 SDKOPGOLD_TYPEWE = 302 //微转发金币类型 diff --git a/src/HttpServer/logic/datadef.go b/src/HttpServer/logic/datadef.go index 0ca9740..fb27bfc 100644 --- a/src/HttpServer/logic/datadef.go +++ b/src/HttpServer/logic/datadef.go @@ -24,6 +24,7 @@ type UserLoginData struct { Userlv int `json:"userlv"` Userexp int `json:"userexp"` Sumloginday int `json:"sumloginday"` + Shakeleftcnt int `json:"shakeleftcnt"` } type UserLoginResp struct { @@ -47,6 +48,7 @@ type GetuserdataData struct { Userexp int `json:"userexp"` Leftfreeredbag int `json:"leftfreeredbag"` Sumloginday int `json:"sumloginday"` + Shakeleftcnt int `json:"shakeleftcnt"` } type GetuserdataResp struct { @@ -381,6 +383,7 @@ type UserData struct { UpLvCostTimeSec int //上一个等级升级的时间点时刻 ReadNum int //玩家微转发阅读量 GetCashCnt int //当天提现次数 + ShakeTime int //摇一摇 WithDraw WithDrawInfo //提现记录信息 //SpecialWithDraw WithDrawInfo //活跃提现记录信息 Task TaskInfo //玩家任务完成相关信息 diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index c09c729..8b9f544 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -489,6 +489,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s initdata.LeftFreeRB = FREE_REDBAG_NUM initdata.UpLvCostTime = 0 initdata.UpLvCostTimeSec = int(time.Now().Unix()) + initdata.ShakeTime = SHAKELIMIT for _, val := range jsonconf.GetJsonConf().WithDrawConfig { var tmp WithDrawDesc @@ -532,6 +533,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s resp.Data.Userlv = initdata.Lv resp.Data.Userexp = initdata.Exp resp.Data.Sumloginday = initdata.SumLoginDay + resp.Data.Shakeleftcnt = initdata.ShakeTime err := SaveUserInfo(&initdata, uniqueuid) if err != nil { @@ -692,6 +694,7 @@ func (u *UserData) HandlePassDay(uuid int, channel string) { u.WatchAddsTime = WATCH_ADD_DAY_LIMIT u.PayAddsTime = PAY_ADD_DAY_LIMIT u.TimeAddsTime = TIME_ADD_DAY_LIMIT + u.ShakeTime = SHAKELIMIT //todo 重置任务相关的数据 u.GetFromGuanCnt = 0 u.GetCashCnt = 0 @@ -914,6 +917,7 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR resp.Data.Userlv = data.Lv resp.Data.Userexp = data.Exp resp.Data.Sumloginday = data.SumLoginDay + resp.Data.Shakeleftcnt = data.ShakeTime return nil } diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index dfa20c1..a8f1822 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -780,6 +780,11 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { if uinfo.TimeAddsTime > 0 { uinfo.TimeAddsTime-- } + case TASKTYPE_SHAKETIME: + uinfo.ShakeTime -= rdata.Value + if uinfo.ShakeTime < 0 { + uinfo.ShakeTime = 0 + } } logger.Info("HandlerUpdatetaskandachieve uinfo=%v rdata=%v", uinfo, rdata) SaveUserInfo(uinfo, uniqueuuid) @@ -1090,6 +1095,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) { resp.Data.Userlv = data.Lv resp.Data.Leftfreeredbag = data.LeftFreeRB resp.Data.Sumloginday = data.SumLoginDay + resp.Data.Shakeleftcnt = data.ShakeTime SaveUserInfo(data, uniqueuuid) resp.Code = ERROR_OK -- libgit2 0.21.0