From e8e88df65d40bdf3ed087cf71bcd22ad95f8437a Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 4 Dec 2024 18:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E7=AD=BE=E5=88=B0=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=20=E6=8F=90=E7=8E=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_home_page.go | 4 +++- app/md/md_home_page.go | 1 + go.mod | 5 ++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/hdl/hdl_home_page.go b/app/hdl/hdl_home_page.go index 7f0e622..8fe8fda 100644 --- a/app/hdl/hdl_home_page.go +++ b/app/hdl/hdl_home_page.go @@ -79,7 +79,7 @@ func HomePage(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return } - + LeaveTimer := "0" if has && utils.TimeParseStd(signIn.EndTime).After(now) { //3.2.1 获取预估每秒获得蛋蛋能量数 estimatePerSecondPersonEggEnergyValue, err1 := decimal.NewFromString(signIn.EstimatePerSecondPersonEggEnergyValue) @@ -96,6 +96,7 @@ func HomePage(c *gin.Context) { signTeamEggEnergy = estimatePerSecondTeamEggEnergyValue.String() isSign = true signCountdown = signIn.EndTime + LeaveTimer = utils.Int64ToStr(utils.TimeStdParseUnix(signIn.EndTime) - time.Now().Unix()) } // 3.3 查询个人及团队蛋蛋能量 @@ -166,6 +167,7 @@ func HomePage(c *gin.Context) { })) resp := md.HomePageResp{ + LeaveTimer: LeaveTimer, IsSign: isSign, SignEndTime: signCountdown, TotalEggEnergy: utils.Float64ToStr(totalEggEnergy), diff --git a/app/md/md_home_page.go b/app/md/md_home_page.go index 89e08d2..4ebef31 100644 --- a/app/md/md_home_page.go +++ b/app/md/md_home_page.go @@ -9,6 +9,7 @@ type HomePageResp struct { NowBasalRate string `json:"now_basal_rate"` // 当前基础速率/小时 NowTeamRate string `json:"now_team_rate"` // 当前团队速率/小时 NickName string `json:"nick_name"` // 用户名称 + LeaveTimer string `json:"leave_timer"` //可签到剩余时间 秒 } type HomePageWatchAdRuleResp struct { diff --git a/go.mod b/go.mod index 9901d07..4b7ace2 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.20.0 github.com/go-redis/redis v6.15.9+incompatible - github.com/gomodule/redigo v2.0.0+incompatible + github.com/gomodule/redigo v1.9.2 github.com/jinzhu/copier v0.4.0 github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 github.com/qiniu/api.v7/v7 v7.8.2 @@ -33,11 +33,10 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241204095350-c895baf67bc5 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241204095556-04ee23549ee5 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241204100652-09a6749b5f44 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible - github.com/gin-contrib/sessions v1.0.1 github.com/go-pay/crypto v0.0.1 github.com/go-pay/gopay v1.5.101 github.com/go-pay/xlog v0.0.2