|
@@ -68,9 +68,9 @@ public abstract class AbstractFilterService {
|
|
|
videoIds = filterByPreViewed(param.getAppType(), param.getMid(), videoIds);
|
|
|
}
|
|
|
if (param.isConcurrent()) {
|
|
|
- videoIds = filterByViewedConcurrent(param.getAppType(), param.getMid(), param.getUid(), videoIds, param.getCityCode(), param.getAbCode());
|
|
|
+ videoIds = filterByViewedConcurrent(param, videoIds);
|
|
|
} else {
|
|
|
- videoIds = filterByViewed(param.getAppType(), param.getMid(), param.getUid(), videoIds, param.getCityCode(), param.getAbCode());
|
|
|
+ videoIds = filterByViewed(param, videoIds);
|
|
|
}
|
|
|
return videoIds;
|
|
|
}
|
|
@@ -96,9 +96,9 @@ public abstract class AbstractFilterService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<Long> filterByViewedConcurrent(int appType, String mid, String uid, List<Long> videoIds, String cityCode, String abCode) {
|
|
|
+ private List<Long> filterByViewedConcurrent(FilterParam param, List<Long> videoIds) {
|
|
|
// TODO uid为空时,还需要过滤么?
|
|
|
- if (StringUtils.isBlank(mid)
|
|
|
+ if (StringUtils.isBlank(param.getMid())
|
|
|
|| CollectionUtils.isEmpty(videoIds)) {
|
|
|
return videoIds;
|
|
|
}
|
|
@@ -118,7 +118,8 @@ public abstract class AbstractFilterService {
|
|
|
List<Future<List<Long>>> futures = new ArrayList<>();
|
|
|
for (final List<Long> ids : chunks) {
|
|
|
Future<List<Long>> future = pool.submit(() ->
|
|
|
- viewedService.filterViewedVideo(appType, mid, uid, ids, cityCode, abCode));
|
|
|
+ viewedService.filterViewedVideo(param.getAppType(), param.getMid(), param.getUid(), ids, param.getCityCode(),
|
|
|
+ param.getAbCode(), param.getHotSceneType()));
|
|
|
futures.add(future);
|
|
|
}
|
|
|
try {
|
|
@@ -142,13 +143,14 @@ public abstract class AbstractFilterService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private List<Long> filterByViewed(int appType, String mid, String uid, List<Long> videoIds, String cityCode, String abCode) {
|
|
|
+ private List<Long> filterByViewed(FilterParam param, List<Long> videoIds) {
|
|
|
// TODO uid为空时,还需要过滤么?
|
|
|
- if (StringUtils.isBlank(mid)
|
|
|
+ if (StringUtils.isBlank(param.getMid())
|
|
|
|| CollectionUtils.isEmpty(videoIds)) {
|
|
|
return videoIds;
|
|
|
}
|
|
|
- return viewedService.filterViewedVideo(appType, mid, uid, videoIds, cityCode, abCode);
|
|
|
+ return viewedService.filterViewedVideo(param.getAppType(), param.getMid(), param.getUid(), videoIds, param.getCityCode(),
|
|
|
+ param.getAbCode(), param.getHotSceneType());
|
|
|
|
|
|
}
|
|
|
|