Explorar o código

WebContext.getServerPort

shimingxy hai 7 meses
pai
achega
05e089358a

+ 4 - 0
maxkey-core/src/main/java/org/dromara/maxkey/web/WebContext.java

@@ -150,6 +150,10 @@ public final class WebContext {
     public static String getProperty(String key) {
     	return properties.getProperty(key);
     }
+    
+    public static String getServerPort() {
+    	return getProperty("server.port");
+    }
 
     // below method is common HttpServlet method
     /**

+ 1 - 1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/MaxKeyApplication.java

@@ -48,7 +48,7 @@ public class MaxKeyApplication extends SpringBootServletInitializer {
         new InitializeContext(applicationContext).init();
         
         _logger.info("MaxKey at {}" , new DateTime());
-        _logger.info("MaxKey Server Port {}" , WebContext.getProperty("server.port"));
+        _logger.info("MaxKey Server Port {}" , WebContext.getServerPort());
         _logger.info("MaxKey started.");
     }
 

+ 1 - 1
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/MaxKeyMgtApplication.java

@@ -45,7 +45,7 @@ public class MaxKeyMgtApplication extends SpringBootServletInitializer {
 		new InitializeContext(applicationContext).init();
 		
 		_logger.info("MaxKeyMgt at {}" , new DateTime());
-		_logger.info("MaxKeyMgt Server Port {}" , WebContext.getProperty("server.port"));
+		_logger.info("MaxKeyMgt Server Port {}" , WebContext.getServerPort());
 		_logger.info("MaxKeyMgt started.");
 		
 	}

+ 1 - 1
maxkey-webs/maxkey-web-openapi/src/main/java/org/dromara/maxkey/MaxKeyOpenApiApplication.java

@@ -46,7 +46,7 @@ public class MaxKeyOpenApiApplication extends SpringBootServletInitializer {
 		new InitializeContext(applicationContext).init();
 		
 		_logger.info("MaxKey OpenApi at {}" , new DateTime());
-		_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getProperty("server.port"));
+		_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getServerPort());
 		_logger.info("MaxKey OpenApi started.");
 		
 	}