更新路径变量注解以明确参数名称
在 `VideoController` 中,为 `@PathVariable` 注解添加了参数名称,以提高代码的可读性和维护性。
This commit is contained in:
parent
4aa92c7c32
commit
517f036726
@ -43,7 +43,7 @@ public class VideoController {
|
||||
}
|
||||
|
||||
@GetMapping("/madou/{id}")
|
||||
public JsonResult<MadouVideoInfo> getMadouVideoById(@PathVariable Long id) {
|
||||
public JsonResult<MadouVideoInfo> 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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user