|
@@ -3,23 +3,26 @@ package com.tzld.piaoquan.recommend.server.service.rank;
|
|
|
import com.tzld.piaoquan.recommend.server.service.rank.strategy.RankStrategy4Density;
|
|
|
import com.tzld.piaoquan.recommend.server.service.rank.strategy.RankStrategy4RankModel;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
public class RankRouter {
|
|
|
+ @Autowired
|
|
|
private RankService rankService;
|
|
|
+ @Autowired
|
|
|
+ private RankStrategy4RankModel rankStrategy4RankModel;
|
|
|
+ @Autowired
|
|
|
+ private RankStrategy4Density rankStrategy4Density;
|
|
|
public RankResult rank(RankParam param) {
|
|
|
String abCode = param.getAbCode();
|
|
|
switch (abCode){
|
|
|
case "60101":
|
|
|
- rankService = new RankStrategy4RankModel();
|
|
|
- break;
|
|
|
+ return rankStrategy4RankModel.rank(param);
|
|
|
case "60098":
|
|
|
- rankService = new RankStrategy4Density();
|
|
|
- break;
|
|
|
+ return rankStrategy4Density.rank(param);
|
|
|
default:
|
|
|
- rankService = new RankService();
|
|
|
break;
|
|
|
}
|
|
|
return rankService.rank(param);
|