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 4b2cabd..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.alibaba.fastjson.JSONObject;
-import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpRequest;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-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;
-import java.util.Enumeration;
-
-@RestController
-@RequestMapping("/zlm")
-public class ZLMHTTPProxyController {
-
-
-    private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class);
-
-    @Autowired
-    private IVideoManagerStorager storager;
-
-
-    @ResponseBody
-    @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8")
-    public Object proxy(HttpServletRequest request, HttpServletResponse response){
-
-        if (storager.getMediaInfo() == null) {
-            return "鏈帴鍏ユ祦濯掍綋";
-        }
-        String requestURI = String.format("http://%s:%s%s?%s&%s",
-                storager.getMediaInfo().getLocalIP(),
-                storager.getMediaInfo().getHttpPort(),
-                request.getRequestURI().replace("/zlm",""),
-                storager.getMediaInfo().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