|
|
@@ -8,6 +8,7 @@ import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreStrate
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
@@ -25,6 +26,14 @@ public class CrawlerDaysDecreaseStrategy implements ScoreStrategy {
|
|
|
@Autowired
|
|
|
private AccountContentPoolConfigService accountContentPoolConfigService;
|
|
|
|
|
|
+ @Value("${recommend.score.crawler-days-decrease.max-release-score:-0.15}")
|
|
|
+ private Double maxReleaseScore;
|
|
|
+ @Value("${recommend.score.crawler-days-decrease.min-score-days:7}")
|
|
|
+ private Double minScoreDays;
|
|
|
+ @Value("${recommend.score.crawler-days-decrease.max-score-days:60}")
|
|
|
+ private Double maxScoreDays;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<Score> score(ScoreParam param) {
|
|
|
List<Score> scores = new ArrayList<>();
|
|
|
@@ -47,9 +56,6 @@ public class CrawlerDaysDecreaseStrategy implements ScoreStrategy {
|
|
|
}
|
|
|
|
|
|
private Double getContentScore(Content content, long now) {
|
|
|
- double maxReleaseScore = -0.15;
|
|
|
- double minScoreDays = 7;
|
|
|
- double maxScoreDays = 60.0;
|
|
|
long timestamp = Optional.ofNullable(content.getRootPublishTimestamp()).orElse(content.getCrawlerTimestamp());
|
|
|
int days = (int) ((now - timestamp) / 86400000);
|
|
|
if (days < minScoreDays) {
|