|
@@ -1,6 +1,7 @@
|
|
|
package com.tzld.longarticle.recommend.server.service.rank.strategy;
|
|
package com.tzld.longarticle.recommend.server.service.rank.strategy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.ContentPoolEnum;
|
|
|
import com.tzld.longarticle.recommend.server.model.Content;
|
|
import com.tzld.longarticle.recommend.server.model.Content;
|
|
|
import com.tzld.longarticle.recommend.server.service.AccountContentPoolConfigService;
|
|
import com.tzld.longarticle.recommend.server.service.AccountContentPoolConfigService;
|
|
|
import com.tzld.longarticle.recommend.server.service.rank.RankItem;
|
|
import com.tzld.longarticle.recommend.server.service.rank.RankItem;
|
|
@@ -133,12 +134,15 @@ public class DefaultRankStrategy implements RankStrategy {
|
|
|
List<String> titles = new ArrayList<>();
|
|
List<String> titles = new ArrayList<>();
|
|
|
List<Content> result = new ArrayList<>();
|
|
List<Content> result = new ArrayList<>();
|
|
|
// 遍历所有列表
|
|
// 遍历所有列表
|
|
|
- for (Content c : contents) {
|
|
|
|
|
- if (similarity(c.getTitle(), titles)) {
|
|
|
|
|
- continue;
|
|
|
|
|
- } else {
|
|
|
|
|
- result.add(c);
|
|
|
|
|
- titles.add(c.getTitle());
|
|
|
|
|
|
|
+ for (String contentPool : ContentPoolEnum.getOrderContentPool()) {
|
|
|
|
|
+ for (Content c : contents) {
|
|
|
|
|
+ if (!contentPool.equals(c.getContentPoolType())) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!similarity(c.getTitle(), titles)) {
|
|
|
|
|
+ result.add(c);
|
|
|
|
|
+ titles.add(c.getTitle());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|