From 713aa00acc398e44cb2a59e4f5c3f55b4e0784d8 Mon Sep 17 00:00:00 2001 From: xiaoQQya <xiaoQQya@126.com> Date: 星期三, 22 三月 2023 15:21:22 +0800 Subject: [PATCH] perf(snap): 优化点播成功后截图使用 rtsp 流, 新增对 H265 编码视频截图的支持 --- src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java index e5f13ec..eab2207 100644 --- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java +++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java @@ -1,28 +1,65 @@ package com.genersoft.iot.vmp; -import java.util.logging.LogManager; - +import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport; +import com.genersoft.iot.vmp.utils.GitUtil; +import com.genersoft.iot.vmp.utils.SpringBeanFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.scheduling.annotation.EnableScheduling; -import springfox.documentation.oas.annotations.EnableOpenApi; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; +import java.util.Collections; + +/** + * 鍚姩绫� + */ +@ServletComponentScan("com.genersoft.iot.vmp.conf") @SpringBootApplication @EnableScheduling -@EnableOpenApi -public class VManageBootstrap extends LogManager { +@EnableDruidSupport +public class VManageBootstrap extends SpringBootServletInitializer { + + private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class); + private static String[] args; private static ConfigurableApplicationContext context; public static void main(String[] args) { VManageBootstrap.args = args; VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); + GitUtil gitUtil1 = SpringBeanFactory.getBean("gitUtil"); + logger.info("鏋勫缓鐗堟湰锛� {}", gitUtil1.getBuildVersion()); + logger.info("鏋勫缓鏃堕棿锛� {}", gitUtil1.getBuildDate()); + logger.info("GIT鏈�鍚庢彁浜ゆ椂闂达細 {}", gitUtil1.getCommitTime()); } // 椤圭洰閲嶅惎 public static void restart() { context.close(); VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); - } + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(VManageBootstrap.class); + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + super.onStartup(servletContext); + + servletContext.setSessionTrackingModes( + Collections.singleton(SessionTrackingMode.COOKIE) + ); + SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig(); + sessionCookieConfig.setHttpOnly(true); + + } } -- Gitblit v1.8.0