|
@@ -8,6 +8,8 @@ import com.tzld.piaoquan.recommend.server.repository.WxVideoStatus;
|
|
|
import com.tzld.piaoquan.recommend.server.repository.WxVideoStatusRepository;
|
|
|
import com.tzld.piaoquan.recommend.server.service.filter.FilterParam;
|
|
|
import com.tzld.piaoquan.recommend.server.service.filter.FilterStrategy;
|
|
|
+import com.tzld.piaoquan.recommend.server.util.JSONUtils;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -28,6 +30,7 @@ import java.util.stream.Collectors;
|
|
|
* @author dyp
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class VideoSourceTypeStrategy implements FilterStrategy {
|
|
|
@Autowired
|
|
|
@Qualifier("redisTemplate")
|
|
@@ -58,7 +61,6 @@ public class VideoSourceTypeStrategy implements FilterStrategy {
|
|
|
@Override
|
|
|
public List<Long> filter(FilterParam param) {
|
|
|
|
|
|
-
|
|
|
if (param == null) {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
@@ -111,13 +113,19 @@ public class VideoSourceTypeStrategy implements FilterStrategy {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
Set<String> notUserUploadUserIds = notUserUploadUserCache.getUnchecked(NOT_USER_UPLOAD_USER_KEY);
|
|
|
|
|
|
-
|
|
|
- return param.getVideoIds().stream()
|
|
|
+ List<Long> videoIds = param.getVideoIds().stream()
|
|
|
.filter(l -> !vid2UidMap.containsKey(l)
|
|
|
|| !notUserUploadUserIds.contains(vid2UidMap.get(l)))
|
|
|
.collect(Collectors.toList());
|
|
|
+ log.info("VideoSourceTypeStrategy \t param={} \t vid2Uid={} \t notUserUploadUserIds={} \t before={} \t " +
|
|
|
+ "after={}",
|
|
|
+ JSONUtils.toJson(param),
|
|
|
+ JSONUtils.toJson(vid2UidMap), JSONUtils.toJson(notUserUploadUserIds),
|
|
|
+ JSONUtils.toJson(param.getVideoIds()),
|
|
|
+ JSONUtils.toJson(videoIds));
|
|
|
+
|
|
|
+ return videoIds;
|
|
|
}
|
|
|
}
|