From e48ef997c03b49c8090970f5fbb29ce80b0ac6df Mon Sep 17 00:00:00 2001 From: 64850858 <648540858@qq.com> Date: 星期三, 14 七月 2021 15:57:39 +0800 Subject: [PATCH] 更换播放器, 修正和优化sql脚本, --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java | 111 +++++++++++++++++++++++++++---------------------------- 1 files changed, 54 insertions(+), 57 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java index b7e0e9a..a00bc2a 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java @@ -1,57 +1,54 @@ -package com.genersoft.iot.vmp.media.zlm; - -import com.genersoft.iot.vmp.conf.MediaServerConfig; -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestTemplate; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@RestController -@RequestMapping("/zlm") -public class ZLMHTTPProxyController { - - - // private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class); - - // @Autowired - // private IVideoManagerStorager storager; - - @Autowired - private IRedisCatchStorage redisCatchStorage; - - @Value("${media.port}") - private int mediaHttpPort; - - @ResponseBody - @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8") - public Object proxy(HttpServletRequest request, HttpServletResponse response){ - - if (redisCatchStorage.getMediaInfo() == null) { - return "鏈帴鍏ユ祦濯掍綋"; - } - MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo(); - String requestURI = String.format("http://%s:%s%s?%s&%s", - mediaInfo.getLocalIP(), - mediaHttpPort, - request.getRequestURI().replace("/zlm",""), - mediaInfo.getHookAdminParams(), - request.getQueryString() - ); - // 鍙戦�佽姹� - RestTemplate restTemplate = new RestTemplate(); - //灏嗘寚瀹氱殑url杩斿洖鐨勫弬鏁拌嚜鍔ㄥ皝瑁呭埌鑷畾涔夊ソ鐨勫搴旂被瀵硅薄涓� - Object result = null; - try { - result = restTemplate.getForObject(requestURI,Object.class); - - }catch (HttpClientErrorException httpClientErrorException) { - response.setStatus(httpClientErrorException.getStatusCode().value()); - } - return result; - } -} +//package com.genersoft.iot.vmp.media.zlm; +// +//import com.genersoft.iot.vmp.conf.MediaConfig; +//import com.genersoft.iot.vmp.storager.IRedisCatchStorage; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.web.bind.annotation.*; +//import org.springframework.web.client.HttpClientErrorException; +//import org.springframework.web.client.RestTemplate; +// +//import javax.servlet.http.HttpServletRequest; +//import javax.servlet.http.HttpServletResponse; +// +//@RestController +//@RequestMapping("/zlm") +//public class ZLMHTTPProxyController { +// +// +// // private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class); +// +// @Autowired +// private IRedisCatchStorage redisCatchStorage; +// +// @Autowired +// private MediaConfig mediaConfig; +// +// @ResponseBody +// @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8") +// public Object proxy(HttpServletRequest request, HttpServletResponse response){ +// +// if (redisCatchStorage.getMediaInfo() == null) { +// return "鏈帴鍏ユ祦濯掍綋"; +// } +// ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo(); +// String requestURI = String.format("http://%s:%s%s?%s&%s", +// mediaInfo.getLocalIP(), +// mediaConfig.getHttpPort(), +// request.getRequestURI().replace("/zlm",""), +// mediaInfo.getHookAdminParams(), +// request.getQueryString() +// ); +// // 鍙戦�佽姹� +// RestTemplate restTemplate = new RestTemplate(); +// //灏嗘寚瀹氱殑url杩斿洖鐨勫弬鏁拌嚜鍔ㄥ皝瑁呭埌鑷畾涔夊ソ鐨勫搴旂被瀵硅薄涓� +// Object result = null; +// try { +// result = restTemplate.getForObject(requestURI,Object.class); +// +// }catch (HttpClientErrorException httpClientErrorException) { +// response.setStatus(httpClientErrorException.getStatusCode().value()); +// } +// return result; +// } +//} -- Gitblit v1.8.0