|
@@ -3,6 +3,7 @@ package com.tzld.piaoquan.recommend.server.service.rank;
|
|
|
|
|
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.tzld.piaoquan.recommend.server.common.enums.AppTypeEnum;
|
|
import com.tzld.piaoquan.recommend.server.common.enums.AppTypeEnum;
|
|
|
|
|
+import com.tzld.piaoquan.recommend.server.model.RankVideoInfo;
|
|
|
import com.tzld.piaoquan.recommend.server.model.Video;
|
|
import com.tzld.piaoquan.recommend.server.model.Video;
|
|
|
import com.tzld.piaoquan.recommend.server.service.flowpool.FlowPoolConstants;
|
|
import com.tzld.piaoquan.recommend.server.service.flowpool.FlowPoolConstants;
|
|
|
import com.tzld.piaoquan.recommend.server.service.recall.RecallResult;
|
|
import com.tzld.piaoquan.recommend.server.service.recall.RecallResult;
|
|
@@ -125,7 +126,7 @@ public abstract class RankService {
|
|
|
}
|
|
}
|
|
|
for (Video video : data.getVideos()) {
|
|
for (Video video : data.getVideos()) {
|
|
|
Set<String> pushFromSet = videoIdPushFromMap.get(video.getVideoId());
|
|
Set<String> pushFromSet = videoIdPushFromMap.get(video.getVideoId());
|
|
|
- if (pushFromSet != null && pushFromSet.size() > 0) {
|
|
|
|
|
|
|
+ if (pushFromSet != null && !pushFromSet.isEmpty()) {
|
|
|
Map<String, List<String>> pushFromIndex = new HashMap<>();
|
|
Map<String, List<String>> pushFromIndex = new HashMap<>();
|
|
|
Map<String, Integer> pushFromRank = new HashMap<>();
|
|
Map<String, Integer> pushFromRank = new HashMap<>();
|
|
|
pushFromSet.forEach(p -> {
|
|
pushFromSet.forEach(p -> {
|
|
@@ -265,15 +266,22 @@ public abstract class RankService {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- protected void addPushFromVideoRank(List<Video> rankVideo) {
|
|
|
|
|
|
|
+ protected void rankBeforePostProcessor(List<Video> rankVideo) {
|
|
|
try {
|
|
try {
|
|
|
- Map<String, List<Long>> pushFromVideoRank = new HashMap<>();
|
|
|
|
|
|
|
+ Map<String, List<Long>> pushFromVideoRank = new LinkedHashMap<>();
|
|
|
|
|
+ Map<Long, RankVideoInfo> rankVideoInfoMap = new LinkedHashMap<>();
|
|
|
for (Video video : rankVideo) {
|
|
for (Video video : rankVideo) {
|
|
|
video.setPushFromRankVideo(pushFromVideoRank);
|
|
video.setPushFromRankVideo(pushFromVideoRank);
|
|
|
|
|
+ video.setRankVideoInfoMap(rankVideoInfoMap);
|
|
|
|
|
|
|
|
String pushFrom = video.getPushFrom();
|
|
String pushFrom = video.getPushFrom();
|
|
|
List<Long> pushFromVideos = pushFromVideoRank.computeIfAbsent(pushFrom, k -> new ArrayList<>());
|
|
List<Long> pushFromVideos = pushFromVideoRank.computeIfAbsent(pushFrom, k -> new ArrayList<>());
|
|
|
pushFromVideos.add(video.getVideoId());
|
|
pushFromVideos.add(video.getVideoId());
|
|
|
|
|
+
|
|
|
|
|
+ RankVideoInfo rankVideoInfo = new RankVideoInfo();
|
|
|
|
|
+ rankVideoInfo.setVideoId(video.getVideoId());
|
|
|
|
|
+ rankVideoInfo.setPushFrom(pushFrom);
|
|
|
|
|
+ rankVideoInfoMap.put(video.getVideoId(), rankVideoInfo);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("addPushFromVideoRank ", e);
|
|
log.error("addPushFromVideoRank ", e);
|