|
70 | 70 | public class DemoApplication implements ApplicationContextAware, WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {
|
71 | 71 | private static final String TAG = "DemoApplication";
|
72 | 72 |
|
| 73 | + public static void main(String[] args) throws Exception { |
| 74 | + SpringApplication.run(DemoApplication.class, args); |
| 75 | + |
| 76 | + // FIXME 不要开放给项目组后端之外的任何人使用 UnitAuto(强制登录鉴权)!!!如果不需要单元测试则移除相关代码或 unitauto.Log.DEBUG = false; |
| 77 | + // 上线生产环境前改为 false,可不输出 APIJSONORM 的日志 以及 SQLException 的原始(敏感)信息 |
| 78 | + unitauto.Log.DEBUG = Log.DEBUG = true; |
| 79 | + APIJSONParser.IS_PRINT_BIG_LOG = true; |
| 80 | + APIJSONApplication.init(); |
| 81 | + System.out.println("\n\n<<<<<<<<< 本 Demo 在 resources/static 内置了 APIAuto,Chrome/Firefox 打开 http://localhost:8080 即可调试(端口号根据项目配置而定) ^_^ >>>>>>>>>\n"); |
| 82 | + } |
| 83 | + |
| 84 | + // SpringBoot 2.x 自定义端口方式 |
| 85 | + @Override |
| 86 | + public void customize(ConfigurableServletWebServerFactory server) { |
| 87 | + server.setPort(8080); |
| 88 | + } |
| 89 | + |
| 90 | + |
73 | 91 | static {
|
74 | 92 | // APIJSON 配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
75 | 93 |
|
@@ -240,22 +258,6 @@ public boolean apply(Object object, String name, Object value) {
|
240 | 258 | }
|
241 | 259 |
|
242 | 260 |
|
243 |
| - public static void main(String[] args) throws Exception { |
244 |
| - SpringApplication.run(DemoApplication.class, args); |
245 |
| - |
246 |
| - // FIXME 不要开放给项目组后端之外的任何人使用 UnitAuto(强制登录鉴权)!!!如果不需要单元测试则移除相关代码或 unitauto.Log.DEBUG = false; |
247 |
| - // 上线生产环境前改为 false,可不输出 APIJSONORM 的日志 以及 SQLException 的原始(敏感)信息 |
248 |
| - unitauto.Log.DEBUG = Log.DEBUG = true; |
249 |
| - APIJSONParser.IS_PRINT_BIG_LOG = true; |
250 |
| - APIJSONApplication.init(); |
251 |
| - System.out.println("\n\n<<<<<<<<< 本 Demo 在 resources/static 内置了 APIAuto,Chrome/Firefox 打开 http://localhost:8080 即可调试(端口号根据项目配置而定) ^_^ >>>>>>>>>\n"); |
252 |
| - } |
253 |
| - |
254 |
| - // SpringBoot 2.x 自定义端口方式 |
255 |
| - @Override |
256 |
| - public void customize(ConfigurableServletWebServerFactory server) { |
257 |
| - server.setPort(8080); |
258 |
| - } |
259 | 261 |
|
260 | 262 | // 全局 ApplicationContext 实例,方便 getBean 拿到 Spring/SpringBoot 注入的类实例
|
261 | 263 | private static ApplicationContext APPLICATION_CONTEXT;
|
|
0 commit comments