From f567cc476c2ceb07924e6566e236d0be010d8d53 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 4 Dec 2024 14:52:38 +0800 Subject: [PATCH] update --- app/hdl/hdl_home_page.go | 6 +++++- app/md/md_home_page.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/hdl/hdl_home_page.go b/app/hdl/hdl_home_page.go index 461775e..436d08d 100644 --- a/app/hdl/hdl_home_page.go +++ b/app/hdl/hdl_home_page.go @@ -231,7 +231,10 @@ func HomePageWatchAdRule(c *gin.Context) { } } nextWatchAdDate, _ := cache.GetString(redisKey) - var nextWatchAdTimes = utils.TimeParseStd(nextWatchAdDate).Unix() - time.Now().Unix() + nextWatchAdTimes := utils.TimeParseStd(nextWatchAdDate).Unix() - time.Now().Unix() + if nextWatchAdTimes < 0 { + nextWatchAdTimes = 0 + } utils.FilePutContents("nextWatchAdDate", utils.SerializeStr(map[string]interface{}{ "nextWatchAdDate": nextWatchAdDate, @@ -245,6 +248,7 @@ func HomePageWatchAdRule(c *gin.Context) { ResidueWatchAdNum: residueWatchAdNum, WatchAdRewardActivePoints: videoRewardSystem.RewardValue, NextWatchAdDate: nextWatchAdDate, + NextWatchAdSecs: nextWatchAdTimes, EachRoundHour: videoRewardSystem.EachRoundHour, } e.OutSuc(c, resp, nil) diff --git a/app/md/md_home_page.go b/app/md/md_home_page.go index c9f3e4a..f708ad5 100644 --- a/app/md/md_home_page.go +++ b/app/md/md_home_page.go @@ -16,6 +16,7 @@ type HomePageWatchAdRuleResp struct { ResidueWatchAdNum int `json:"residue_watch_ad_num"` // 当前剩余可观看视频数 WatchAdRewardActivePoints string `json:"watch_ad_reward_active_points"` // 观看广告视频奖励X个活跃积分 NextWatchAdDate string `json:"next_watch_ad_date"` // 下次可观看广告时间,若为空允许观看视频 + NextWatchAdSecs int64 `json:"next_watch_ad_secs"` // 下次可观看广告时间,若为空允许观看视频 EachRoundHour string `json:"each_round_hour"` // 每一轮X个小时 }