|
@@ -4,14 +4,19 @@ import com.google.protobuf.InvalidProtocolBufferException;
|
|
|
import com.tzld.piaoquan.recommend.server.client.ProtobufUtils;
|
|
|
import com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest;
|
|
|
import com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse;
|
|
|
+import com.tzld.piaoquan.recommend.server.model.FilterVideoRequest;
|
|
|
import com.tzld.piaoquan.recommend.server.service.VideoRecommendService;
|
|
|
+import com.tzld.piaoquan.recommend.server.service.filter.strategy.BlacklistContainer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.slf4j.MDC;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
/**
|
|
|
* @author dyp
|
|
|
*/
|
|
@@ -20,6 +25,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class RecommendV2Controller {
|
|
|
@Autowired
|
|
|
private VideoRecommendService videoRecommendService;
|
|
|
+ @Autowired
|
|
|
+ private BlacklistContainer blacklistContainer;
|
|
|
//
|
|
|
// @Resource
|
|
|
// TopRecommendPipeline topRecommendPipeline;
|
|
@@ -54,6 +61,21 @@ public class RecommendV2Controller {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/filterVideos")
|
|
|
+ public String filterVideos(@RequestBody FilterVideoRequest request){
|
|
|
+ blacklistContainer.filterUnsafeVideoByUser(
|
|
|
+ request.getVideoIds(),
|
|
|
+ request.getUid(),
|
|
|
+ request.getHotSceneType(),
|
|
|
+ request.getCityCode(),
|
|
|
+ request.getClientIP(),
|
|
|
+ request.getMid(),
|
|
|
+ "devtest",
|
|
|
+ request.getAppType()
|
|
|
+ );
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
// @RequestMapping("/test/feedByRec")
|
|
|
// public String feedByRec(@RequestBody RecommendRequest httpRequest) {
|
|
|
// MDC.put("appType", String.valueOf(httpRequest.getAppType()));
|