mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、广告分页查询广告位置组合查询修复;2、短信ip/手机号限制zset设置ttl;
This commit is contained in:
+7
-6
@@ -25,17 +25,18 @@ public interface AdvertisementMapper extends BaseMapperX<AdvertisementDO> {
|
|||||||
|
|
||||||
default PageResult<AdvertisementDO> selectPage(AdvertisementPageReqVO reqVO) {
|
default PageResult<AdvertisementDO> selectPage(AdvertisementPageReqVO reqVO) {
|
||||||
|
|
||||||
List<Integer> adPosition = reqVO.getAdPosition();
|
|
||||||
String adPositionStr = null;
|
|
||||||
if(CollUtil.isNotEmpty(adPosition)) {
|
|
||||||
adPositionStr = CollUtil.join(adPosition.stream().sorted().distinct().toList(), ",");
|
|
||||||
}
|
|
||||||
LambdaQueryWrapperX<AdvertisementDO> queryWrapper = new LambdaQueryWrapperX<AdvertisementDO>()
|
LambdaQueryWrapperX<AdvertisementDO> queryWrapper = new LambdaQueryWrapperX<AdvertisementDO>()
|
||||||
.likeIfPresent(AdvertisementDO::getAdName, reqVO.getAdName())
|
.likeIfPresent(AdvertisementDO::getAdName, reqVO.getAdName())
|
||||||
.likeIfPresent(AdvertisementDO::getAdPosition, adPositionStr)
|
|
||||||
.eqIfPresent(AdvertisementDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(AdvertisementDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(AdvertisementDO::getDeleted, false);
|
.eqIfPresent(AdvertisementDO::getDeleted, false);
|
||||||
|
|
||||||
|
List<Integer> adPosition = reqVO.getAdPosition();
|
||||||
|
if (CollUtil.isNotEmpty(adPosition)) {
|
||||||
|
queryWrapper.and(wrapper -> {
|
||||||
|
adPosition.stream().distinct().forEach(pos -> wrapper.or().apply("FIND_IN_SET({0}, ad_position)", pos));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return selectPage(reqVO, queryWrapper);
|
return selectPage(reqVO, queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -29,6 +29,7 @@ import jakarta.annotation.Resource;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static cn.hutool.core.util.RandomUtil.randomInt;
|
import static cn.hutool.core.util.RandomUtil.randomInt;
|
||||||
|
|
||||||
@@ -163,6 +164,8 @@ public class SmsCodeServiceImpl implements SmsCodeService {
|
|||||||
// 窗口足够添加当前请求的时间戳
|
// 窗口足够添加当前请求的时间戳
|
||||||
redisTemplate.opsForZSet().add(key, currentTime, currentTime);
|
redisTemplate.opsForZSet().add(key, currentTime, currentTime);
|
||||||
|
|
||||||
|
// 设置过期时间 = 窗口大小 + 30分钟缓冲
|
||||||
|
redisTemplate.expire(key, winSizeMin + 30, TimeUnit.MINUTES);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
ad_redirect_url
|
ad_redirect_url
|
||||||
from advertisement
|
from advertisement
|
||||||
where deleted = false
|
where deleted = false
|
||||||
and ad_position like concat('%', #{adPosition},'%')
|
and find_in_set (#{adPosition}, ad_position)
|
||||||
and status = #{status}
|
and status = #{status}
|
||||||
and start_time <= #{now}
|
and start_time <= #{now}
|
||||||
and end_time >= #{now}
|
and end_time >= #{now}
|
||||||
|
|||||||
Reference in New Issue
Block a user