feat: 1.uni-ad广告回调接入 2.广告奖励免费观看时长
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.sqx.modules.redisService.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -68,6 +69,7 @@ public class RedisServiceImpl implements RedisService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean getFreeWatchTimeIsExpire(Long userId) {
|
||||
String freeWatchKey = RedisKeys.getFreeWatchKey(userId, true);
|
||||
@@ -98,8 +100,12 @@ public class RedisServiceImpl implements RedisService {
|
||||
|
||||
Integer second = jsonObject.getInteger("second");
|
||||
if (expireTime == -1) {
|
||||
jsonObject.put("expireTime", DateUtil.offsetSecond(DateUtil.date(), second).getTime());
|
||||
redisUtils.set(watchKey, jsonObject.toJSONString(), -1);
|
||||
DateTime now = DateUtil.date();
|
||||
jsonObject.put("expireTime", DateUtil.offsetSecond(now, second).getTime());
|
||||
Date tomorrow = DateUtil.beginOfDay(DateUtil.offsetDay(now, 1));
|
||||
long expire = DateUtil.between(now, tomorrow, DateUnit.SECOND);
|
||||
|
||||
redisUtils.set(watchKey, jsonObject.toJSONString(), expire);
|
||||
return false;
|
||||
}else {
|
||||
return DateUtil.current() > expireTime;
|
||||
|
||||
Reference in New Issue
Block a user