可选是否要文件头

This commit is contained in:
shikong 2023-09-21 14:58:15 +08:00
parent b12cdba22f
commit f5da6cf084
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,6 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
@Slf4j @Slf4j
@ -45,11 +44,11 @@ public class VideoController {
@Operation(summary = "获取视频 (目前仅供测试)") @Operation(summary = "获取视频 (目前仅供测试)")
@GetMapping(produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @GetMapping(produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
@ResponseBody @ResponseBody
public void video(HttpServletRequest request, HttpServletResponse response, @ParameterObject VideoReq req, @RequestParam(value = "fileHeader",required = false) Boolean fileHeader) { public void video(HttpServletRequest request, HttpServletResponse response, @ParameterObject VideoReq req) {
if(proxyConfig.getEnable()){ if(proxyConfig.getEnable()){
wvpService.video(request,response,req.getDeviceCode(), req.getStartTime(), req.getEndTime()); wvpService.video(request,response,req.getDeviceCode(), req.getStartTime(), req.getEndTime());
} else { } else {
gb28181DownloadService.video(request,response,req.getDeviceCode(), req.getStartTime(), req.getEndTime(),fileHeader); gb28181DownloadService.video(request,response,req.getDeviceCode(), req.getStartTime(), req.getEndTime(), req.getFileHeader());
} }
} }
} }

View File

@ -30,6 +30,9 @@ public class VideoReq {
@JsonFormat(pattern = DatePattern.PURE_DATETIME_PATTERN) @JsonFormat(pattern = DatePattern.PURE_DATETIME_PATTERN)
private Date endTime; private Date endTime;
@Schema(description = "http 头是否需要文件名")
private Boolean fileHeader = false;
public void setDevice_id(String deviceCode){ public void setDevice_id(String deviceCode){
this.deviceCode = deviceCode; this.deviceCode = deviceCode;
} }