|
@@ -2,6 +2,8 @@ package com.tzld.piaoquan.recommend.server.service.rank;
|
|
|
|
|
|
import com.tzld.piaoquan.recommend.server.service.ServiceBeanFactory;
|
|
import com.tzld.piaoquan.recommend.server.service.ServiceBeanFactory;
|
|
import com.tzld.piaoquan.recommend.server.service.rank.strategy.*;
|
|
import com.tzld.piaoquan.recommend.server.service.rank.strategy.*;
|
|
|
|
+import com.tzld.piaoquan.recommend.server.util.CommonCollectionUtils;
|
|
|
|
+import com.tzld.piaoquan.recommend.server.util.JSONUtils;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -43,12 +45,13 @@ public class RankRouter {
|
|
if (CollectionUtils.isNotEmpty(abExpCodes)) {
|
|
if (CollectionUtils.isNotEmpty(abExpCodes)) {
|
|
for (Map.Entry<String, RankService> entry : strategyMap.entrySet()) {
|
|
for (Map.Entry<String, RankService> entry : strategyMap.entrySet()) {
|
|
if (abExpCodes.contains(entry.getKey())) {
|
|
if (abExpCodes.contains(entry.getKey())) {
|
|
|
|
+ log.info("rank strategies {} {}", entry.getKey(), entry.getValue().getClass().getSimpleName());
|
|
return entry.getValue().rank(param);
|
|
return entry.getValue().rank(param);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
Optional<RankService> defaultStrategy = strategyMap.values().stream().findFirst();
|
|
Optional<RankService> defaultStrategy = strategyMap.values().stream().findFirst();
|
|
if (defaultStrategy.isPresent()) {
|
|
if (defaultStrategy.isPresent()) {
|
|
return defaultStrategy.get().rank(param);
|
|
return defaultStrategy.get().rank(param);
|