From f24e0fba056c411f1ecd2d866d520fe6a0bbd9d8 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Tue, 19 May 2020 17:02:07 +0800 Subject: [PATCH] 提交修改 --- src/HttpServer/logic/constdef.go | 4 ++-- src/HttpServer/logic/datadef.go | 14 +++++++------- src/HttpServer/logic/function.go | 4 ++-- src/HttpServer/logic/httpserver.go | 5 +++++ src/HttpServer/logic/logic.go | 5 ++++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/HttpServer/logic/constdef.go b/src/HttpServer/logic/constdef.go index 144b547..7fe129d 100644 --- a/src/HttpServer/logic/constdef.go +++ b/src/HttpServer/logic/constdef.go @@ -48,6 +48,6 @@ const ( ) const ( - WATCH_ADD_DAY_LIMIT = 9 //当天观看视频次数限制 - FREE_REDBAG_NUM = 3 //玩家免费红包次数 + WATCH_ADD_DAY_LIMIT = 50 //当天获取红包次数限制 + FREE_REDBAG_NUM = 3 //玩家免费红包次数 ) diff --git a/src/HttpServer/logic/datadef.go b/src/HttpServer/logic/datadef.go index f56c0e6..dac40e9 100644 --- a/src/HttpServer/logic/datadef.go +++ b/src/HttpServer/logic/datadef.go @@ -8,11 +8,11 @@ type UserLoginReq struct { } type UserLoginData struct { - Walletgold int `json:"walletgold"` - Leftads int `json:"leftads"` - Guangold int `json:"guangold"` - Userlv int `json:"userlv"` - Userexp int `json:"userexp"` + Walletgold int `json:"walletgold"` + Leftredbagcnt int `json:"leftredbagcnt"` + Guangold int `json:"guangold"` + Userlv int `json:"userlv"` + Userexp int `json:"userexp"` } type UserLoginResp struct { @@ -28,7 +28,7 @@ type GetuserdataReq struct { type GetuserdataData struct { Walletgold int `json:"walletgold"` - Leftads int `json:"leftads"` + Leftredbagcnt int `json:"leftredbagcnt"` Guangold int `json:"guangold"` Userlv int `json:"userlv"` Userexp int `json:"userexp"` @@ -286,7 +286,7 @@ type UserData struct { Exp int //玩家当前经验值 GuanGold int //玩家存钱罐中金币数量 RealGold int //玩家实际金币数量(可用于提现的) - WatchAddsTime int //当天观看激励视频次数 + WatchAddsTime int //当天剩余红包次数 初始化50次 LastLoginTime int //上次登陆时间 ContinueLoginDay int //连续登录天数 GetFromGuanCnt int //当天从存钱款提取金币次数 diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index 10869ee..2b86ef0 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -464,7 +464,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int) error { } resp.Data.Guangold = initdata.GuanGold - resp.Data.Leftads = initdata.WatchAddsTime + resp.Data.Leftredbagcnt = initdata.WatchAddsTime resp.Data.Walletgold = initdata.RealGold resp.Data.Userlv = initdata.Lv @@ -641,7 +641,7 @@ func GetUserData(uuid int, req *UserLoginReq, resp *UserLoginResp) error { SaveUserInfo(data) resp.Data.Walletgold = data.RealGold - resp.Data.Leftads = data.WatchAddsTime + resp.Data.Leftredbagcnt = data.WatchAddsTime resp.Data.Guangold = data.GuanGold resp.Data.Userlv = data.Lv resp.Data.Userexp = data.Exp diff --git a/src/HttpServer/logic/httpserver.go b/src/HttpServer/logic/httpserver.go index ce256d5..6f3acfc 100644 --- a/src/HttpServer/logic/httpserver.go +++ b/src/HttpServer/logic/httpserver.go @@ -407,6 +407,11 @@ func Queryguaninfo(w http.ResponseWriter, r *http.Request) { func Watchads(w http.ResponseWriter, r *http.Request) { + //这个接口作废 + logger.Info("Watchads is not used") + SetHeader(w) + + return Uuid := 0 if len(r.Header) > 0 { Uuid, _ = strconv.Atoi(r.Header.Get("Uuid")) diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index c43ee37..b6239fc 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -526,6 +526,9 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { if uinfo.LeftFreeRB > 0 { uinfo.LeftFreeRB-- } + if uinfo.WatchAddsTime > 0 { + uinfo.WatchAddsTime-- + } case TASKTYPE_WATCHADS: uinfo.Achieve.WatchAdsCnt += rdata.Value case TASKTYPE_KILLSTAR: @@ -807,7 +810,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) { resp.Data.Walletgold = data.RealGold resp.Data.Guangold = data.GuanGold - resp.Data.Leftads = data.WatchAddsTime + resp.Data.Leftredbagcnt = data.WatchAddsTime resp.Data.Userexp = data.Exp resp.Data.Userlv = data.Lv resp.Data.Leftfreeredbag = data.LeftFreeRB -- libgit2 0.21.0