dengbiao hace 2 semanas
padre
commit
7ed743ea55
Se han modificado 5 ficheros con 28 adiciones y 0 borrados
  1. +16
    -0
      app/hdl/hdl_home_page.go
  2. +1
    -0
      app/md/md_home_page.go
  3. +4
    -0
      docs/docs.go
  4. +4
    -0
      docs/swagger.json
  5. +3
    -0
      docs/swagger.yaml

+ 16
- 0
app/hdl/hdl_home_page.go Ver fichero

@@ -235,6 +235,21 @@ func HomePageWatchAdRule(c *gin.Context) {
if nextWatchAdTimes < 0 {
nextWatchAdTimes = 0
}
var roundRemainingSecs int64
now := time.Now()
nowStr := now.Format("2006-01-02 15:04:05")
signInDb := implement.NewEggSignInDb(db.Db)
has, signIn, err := signInDb.EggSignInGetOne(nowStr, nowStr, user.Id)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if has {
roundRemainingSecs = utils.TimeParseStd(signIn.EndTime).Unix() - time.Now().Unix()
if roundRemainingSecs < 0 {
roundRemainingSecs = 0
}
}

utils.FilePutContents("nextWatchAdDate", utils.SerializeStr(map[string]interface{}{
"nextWatchAdDate": nextWatchAdDate,
@@ -250,6 +265,7 @@ func HomePageWatchAdRule(c *gin.Context) {
NextWatchAdDate: nextWatchAdDate,
NextWatchAdSecs: nextWatchAdTimes,
EachRoundHour: videoRewardSystem.EachRoundHour,
RoundRemainingSecs: roundRemainingSecs,
}
e.OutSuc(c, resp, nil)
}


+ 1
- 0
app/md/md_home_page.go Ver fichero

@@ -18,6 +18,7 @@ type HomePageWatchAdRuleResp struct {
NextWatchAdDate string `json:"next_watch_ad_date"` // 下次可观看广告时间,若为空允许观看视频
NextWatchAdSecs int64 `json:"next_watch_ad_secs"` // 下次可观看广告时间,若为空允许观看视频
EachRoundHour string `json:"each_round_hour"` // 每一轮X个小时
RoundRemainingSecs int64 `json:"round_remaining_secs"` // 本轮剩余时间
}

type RealTimePriceResp struct {


+ 4
- 0
docs/docs.go Ver fichero

@@ -4079,6 +4079,10 @@ const docTemplate = `{
"description": "总可观看广告数量",
"type": "string"
},
"round_remaining_secs": {
"description": "本轮剩余时间",
"type": "integer"
},
"watch_ad_reward_active_points": {
"description": "观看广告视频奖励X个活跃积分",
"type": "string"


+ 4
- 0
docs/swagger.json Ver fichero

@@ -4073,6 +4073,10 @@
"description": "总可观看广告数量",
"type": "string"
},
"round_remaining_secs": {
"description": "本轮剩余时间",
"type": "integer"
},
"watch_ad_reward_active_points": {
"description": "观看广告视频奖励X个活跃积分",
"type": "string"


+ 3
- 0
docs/swagger.yaml Ver fichero

@@ -675,6 +675,9 @@ definitions:
reward_total_num:
description: 总可观看广告数量
type: string
round_remaining_secs:
description: 本轮剩余时间
type: integer
watch_ad_reward_active_points:
description: 观看广告视频奖励X个活跃积分
type: string


Cargando…
Cancelar
Guardar