From e88d34fd4cbe3a0cc57ecfdc1710d66bc88e26b5 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期二, 10 六月 2025 14:07:53 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/video/VideoCtrl.java | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 120 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/video/VideoCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/video/VideoCtrl.java new file mode 100644 index 0000000..627f0b0 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/video/VideoCtrl.java @@ -0,0 +1,120 @@ +package com.dy.pipIrrRemote.video; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoVi.ViYsApp; +import com.dy.pipIrrGlobal.util.CameraTypeEnum; +import com.dy.pipIrrGlobal.voVi.VoCamera; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/9 10:34 + * @Description + */ +@Slf4j +@Tag(name = "瑙嗛鐩戞帶", description = "瑙嗛鐩戞帶") +@RestController +@RequestMapping(path = "video") +@RequiredArgsConstructor +public class VideoCtrl { + private VideoSv sv; + private YsAppSv ysSv; + + @Value("${video.screen.count: 4}") + private Integer pageSize;//姣忛〉鏄剧ず鏉℃暟 + + @Value("${video.ys.requestVideoCommonUrl: https://open.ys7.com/console/jssdk/pc.html}") + private String requestVideoCommonUrl;// + @Value("${video.ys.requestVideoCameraPreUrl: ezopen://open.ys7.com/}") + private String requestVideoCameraPreUrl;// + @Value("${video.ys.requestVideoCameraTailUrl: /1.live&themeId=}") + private String requestVideoCameraTailUrl;// + + @Autowired + private void setSv(VideoSv sv, YsAppSv ysSv){ + this.sv = sv ; + this.ysSv = ysSv ; + } + + + /** + * 瀹㈡埛绔姹傚緱鍒颁竴浜涙憚鍍忔満鏁版嵁 + * @return 鎵�鏈夋憚鍍忔満鏁版嵁 + */ + @Operation(summary = "鑾峰緱涓�椤垫憚鍍忔満鏁版嵁", description = "杩斿洖涓�椤垫憚鍍忔満鏁版嵁鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤垫憚鍍忔満鏁版嵁锛圔aseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoCamera.class))} + ) + }) + @GetMapping(path = "some") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoVideo>>> some(VideoQo queryQo){ + try { + ViYsApp ysApp = this.ysSv.selectSingleton() ; + if(ysApp == null){ + //remote妯″潡鐨勮嚜鍔ㄤ换鍔″彲鑳芥竻绌轰簡锛屾墍浠ュ啀鏌ヨ涓�娆� + ysApp = this.ysSv.selectSingleton() ; + } + List<VoVideo> list = new ArrayList<>() ; + QueryResultVo<List<VoCamera>> resTmp = this.sv.some(queryQo, pageSize) ; + if(resTmp != null && resTmp.obj != null){ + for(VoCamera vo : resTmp.obj){ + VoVideo vvo = new VoVideo() ; + vvo.id = vo.id ; + vvo.name = vo.name ; + if(ysApp != null && vo.type != null && vo.type.byteValue() == CameraTypeEnum.YINGSHI.getType().byteValue()){ + //钀ょ煶 + StringBuilder sb = new StringBuilder(); + sb.append(requestVideoCommonUrl); + sb.append("?accessToken="); + sb.append(ysApp.accessToken); + sb.append("&url="); + sb.append(requestVideoCameraPreUrl); + sb.append(vo.devNo); + sb.append(requestVideoCameraTailUrl); + vvo.videoUrl4Simple = sb.toString() + "simple"; + vvo.videoUrl4Standard = sb.toString() + "standard" ; + vvo.videoUrl4Security = sb.toString() + "security" ; + }else{ + vvo.videoUrl4Simple = "" ; + vvo.videoUrl4Standard = "" ; + vvo.videoUrl4Security = "" ; + } + list.add(vvo) ; + } + } + QueryResultVo<List<VoVideo>> res = new QueryResultVo<>() ; + resTmp.copyTo(res); + res.obj = list ; + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鏌ヨ鎽勫儚鏈哄紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } +} -- Gitblit v1.8.0