소스 검색

/recommend 接口最多可获取 100 页数据

reghao 1 년 전
부모
커밋
7958e26620
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/VideoQueryController.java

+ 4 - 0
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/VideoQueryController.java

@@ -82,6 +82,10 @@ public class VideoQueryController {
     @ApiOperation(value = "获取推荐视频", notes = "N")
     @GetMapping(value = "/recommend", produces = MediaType.APPLICATION_JSON_VALUE)
     public String getRecommendVideos(@RequestParam(value = "nextId", required = false) String nextId) {
+        if (Integer.parseInt(nextId) > 100) {
+            return WebResult.failWithMsg("已经到底啦~ 重新开始吧");
+        }
+
         long userId = UserContext.getUser();
         List<VideoCard> list = recommendService.getRecommendVideos(userId, nextId);
         return WebResult.success(list);