feat: 1.uni-ad广告回调接入 2.广告奖励免费观看时长

This commit is contained in:
张松
2024-12-23 16:16:36 +08:00
parent f4e93e748e
commit f11ae848b0
18 changed files with 607 additions and 18 deletions

View File

@@ -98,7 +98,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
* @return true 可观看
*/
private boolean checkFreeWatchPayCount(Long userId) {
Boolean isExpire = redisServiceImpl.getPayFreeWatchTimeIsExpire(userId);
Boolean isExpire = redisServiceImpl.getFreeWatchTimeIsExpire(userId);
if (isExpire == null) {
Integer count = ordersDao.countPayOrderByDay(userId);
CommonInfo needCountCommonInfo = commonInfoDao.selectOne(new LambdaQueryWrapper<CommonInfo>()
@@ -113,7 +113,9 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
// 购买次数超过设置redis标识
if (count >= Integer.parseInt(needCountCommonInfo.getValue())) {
redisServiceImpl.setPayFreeWatchTime(userId, Integer.parseInt(freeTimeCommonInfo.getValue()));
redisServiceImpl.setFreeWatchTime(userId, Integer.parseInt(freeTimeCommonInfo.getValue()), false);
// 触发计时
redisServiceImpl.getFreeWatchTimeIsExpire(userId);
isExpire = false;
}else {
isExpire = true;