|
@@ -18,8 +18,11 @@ import java.util.Objects;
|
|
|
@Slf4j
|
|
|
public class OldStrategy implements FilterStrategy {
|
|
|
|
|
|
- @Value("${filter.old.strategy.days:60}")
|
|
|
- private Integer filterOldStrategyDays;
|
|
|
+ @Value("${filter.old.strategy.rootPublish.days:30}")
|
|
|
+ private Integer filterOldStrategyRootPublishDays;
|
|
|
+
|
|
|
+ @Value("${filter.old.strategy.create.days:90}")
|
|
|
+ private Integer filterOldStrategyCreateDays;
|
|
|
|
|
|
@Override
|
|
|
public FilterResult filter(FilterParam param) {
|
|
@@ -30,10 +33,11 @@ public class OldStrategy implements FilterStrategy {
|
|
|
for (Content content : contents) {
|
|
|
if (ContentPoolEnum.autoArticlePoolLevel4.getContentPool().equals(content.getContentPoolType())
|
|
|
&& Objects.nonNull(content.getRootPublishTimestamp())
|
|
|
- && content.getRootPublishTimestamp() < DateUtils.getTodayStart() - filterOldStrategyDays * 86400000L) {
|
|
|
+ && (content.getRootPublishTimestamp() < DateUtils.getTodayStart() - filterOldStrategyRootPublishDays * 86400000L
|
|
|
+ || content.getCreateTimestamp() < DateUtils.getTodayStart() - filterOldStrategyCreateDays * 86400000L)) {
|
|
|
content.setFilterReason("冷启老文章过滤");
|
|
|
filterContents.add(content);
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
result.add(content.getId());
|
|
|
}
|
|
|
}
|