Sfoglia il codice sorgente

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

reghao 1 anno fa
parent
commit
7958e26620

+ 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);