ZLMHTTPProxyController.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //package com.genersoft.iot.vmp.media.zlm;
  2. //
  3. //import com.genersoft.iot.vmp.conf.MediaConfig;
  4. //import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
  5. //import org.springframework.beans.factory.annotation.Autowired;
  6. //import org.springframework.beans.factory.annotation.Value;
  7. //import org.springframework.web.bind.annotation.*;
  8. //import org.springframework.web.client.HttpClientErrorException;
  9. //import org.springframework.web.client.RestTemplate;
  10. //
  11. //import javax.servlet.http.HttpServletRequest;
  12. //import javax.servlet.http.HttpServletResponse;
  13. //
  14. //@RestController
  15. //@RequestMapping("/zlm")
  16. //public class ZLMHTTPProxyController {
  17. //
  18. //
  19. // // private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class);
  20. //
  21. // @Autowired
  22. // private IRedisCatchStorage redisCatchStorage;
  23. //
  24. // @Autowired
  25. // private MediaConfig mediaConfig;
  26. //
  27. // @ResponseBody
  28. // @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8")
  29. // public Object proxy(HttpServletRequest request, HttpServletResponse response){
  30. //
  31. // if (redisCatchStorage.getMediaInfo() == null) {
  32. // return "未接入流媒体";
  33. // }
  34. // ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
  35. // String requestURI = String.format("http://%s:%s%s?%s&%s",
  36. // mediaInfo.getLocalIP(),
  37. // mediaConfig.getHttpPort(),
  38. // request.getRequestURI().replace("/zlm",""),
  39. // mediaInfo.getHookAdminParams(),
  40. // request.getQueryString()
  41. // );
  42. // // 发送请求
  43. // RestTemplate restTemplate = new RestTemplate();
  44. // //将指定的url返回的参数自动封装到自定义好的对应类对象中
  45. // Object result = null;
  46. // try {
  47. // result = restTemplate.getForObject(requestURI,Object.class);
  48. //
  49. // }catch (HttpClientErrorException httpClientErrorException) {
  50. // response.setStatus(httpClientErrorException.getStatusCode().value());
  51. // }
  52. // return result;
  53. // }
  54. //}