diff --git a/src/HttpServer/logic/datadef.go b/src/HttpServer/logic/datadef.go index 9744c36..d8f4d29 100644 --- a/src/HttpServer/logic/datadef.go +++ b/src/HttpServer/logic/datadef.go @@ -258,10 +258,11 @@ type ExchangePosReq struct { } type ExchangePosData struct { - CatList []CatPosInfo `json:"catList"` - Coin DoBuyCatCoin `json:"coin"` - NewCat int `json:"newCat"` - Reward float32 `json:"reward"` + CatList []CatPosInfo `json:"catList"` + Coin DoBuyCatCoin `json:"coin"` + NewCat int `json:"newCat"` + Reward float32 `json:"reward"` + CostTime int `json:"costTime"` } type ExchangePosResp struct { Code int `json:"code"` @@ -950,6 +951,8 @@ type UserData struct { Goldrate int64 //金币生成速率 Loverate int64 //爱心生产速率 Highestlv int //当前最高猫等级 + CurentLevelSec int //升级到当前猫等级的时间点 + CurentLevelCostTime int //升级到当前猫等级所花的时间 InviteId int //邀请者uid CurBoxLv int //当前猫箱子等级 IsDouble int //当前加速标签 1表示3倍收益 0表示正常 diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index 4a4ad61..9767495 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -2422,6 +2422,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { //非红包猫 uinfo.Highestlv = 37 uinfo.CheckBuyCatSHop() + //记录升级到37级猫的时间点 + nowt := int(time.Now().Unix()) + uinfo.CurentLevelCostTime = (nowt - uinfo.CurentLevelSec) / 3600 + uinfo.CurentLevelSec = nowt + resp.Data.CostTime = uinfo.CurentLevelCostTime + } if idx > 0 { //红包猫 @@ -2443,6 +2449,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { //翻拍次数+ uinfo.FlopCardLefCnt++ + + nowt := int(time.Now().Unix()) + uinfo.CurentLevelCostTime = (nowt - uinfo.CurentLevelSec) / 3600 + uinfo.CurentLevelSec = nowt + + resp.Data.CostTime = uinfo.CurentLevelCostTime } } -- libgit2 0.21.0