From 517f0367262724f8747e5e0d831c8f9507f978f2 Mon Sep 17 00:00:00 2001 From: yanlongqi Date: Sat, 28 Dec 2024 20:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B7=AF=E5=BE=84=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=B3=A8=E8=A7=A3=E4=BB=A5=E6=98=8E=E7=A1=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 `VideoController` 中,为 `@PathVariable` 注解添加了参数名称,以提高代码的可读性和维护性。 --- .../crawler/video/models/controller/VideoController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/top/yuchat/crawler/video/models/controller/VideoController.java b/src/main/java/top/yuchat/crawler/video/models/controller/VideoController.java index 6d606fa..ba5f3a1 100644 --- a/src/main/java/top/yuchat/crawler/video/models/controller/VideoController.java +++ b/src/main/java/top/yuchat/crawler/video/models/controller/VideoController.java @@ -43,7 +43,7 @@ public class VideoController { } @GetMapping("/madou/{id}") - public JsonResult getMadouVideoById(@PathVariable Long id) { + public JsonResult getMadouVideoById(@PathVariable("id") Long id) { MadouVideoInfo madouVideoInfo = madouVideoService.getById(id); madouVideoInfo.setM3u8Url("/api/video/" + id + "/index.m3u8"); return JsonResult.ok(madouVideoInfo); @@ -52,13 +52,13 @@ public class VideoController { @ResponseBody @GetMapping("/{id}/index.m3u8") - public String getM3u8(@PathVariable Long id) throws IOException { + public String getM3u8(@PathVariable("id") Long id) throws IOException { return madouVideoService.getM3u8(id); } @ResponseBody @GetMapping("/{id}/{ts}") - public void getM3u8(@PathVariable Long id, @PathVariable String ts) throws IOException { + public void getM3u8(@PathVariable("id") Long id, @PathVariable("ts") String ts) throws IOException { madouVideoService.downloadTs(id, ts); }