瀏覽代碼

打包调整资源文件

lyhzzz 3 年之前
父節點
當前提交
b57b678b58

+ 11 - 3
platform-api/src/main/java/com/platform/PlatformApplication.java

@@ -17,10 +17,12 @@ import org.springframework.context.annotation.ComponentScan;
 @ComponentScan(basePackages = {"com.platform.*"})
 @EnableDiscoveryClient
 @SpringBootApplication
-public class PlatformApplication implements ApplicationContextAware {
+public class PlatformApplication extends SpringBootServletInitializer implements ApplicationContextAware {
 
-	public static void main(String[] args) {
-		SpringApplication.run(PlatformApplication.class, args);
+
+	@Override
+	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+		return builder.sources(PlatformApplication.class);
 	}
 
 	@Override
@@ -28,4 +30,10 @@ public class PlatformApplication implements ApplicationContextAware {
 		SpringContextUtils.setApplicationContext(applicationContext);
 
 	}
+
+	public static void main(String[] args) {
+		SpringApplication.run(PlatformApplication.class, args);
+	}
+
+
 }

+ 0 - 26
platform-api/src/main/java/com/platform/config/NacosConfig.java

@@ -1,26 +0,0 @@
-package com.platform.config;
-
-import com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration;
-import com.alibaba.cloud.nacos.registry.NacosRegistration;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.event.ApplicationReadyEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class NacosConfig implements ApplicationListener<ApplicationReadyEvent> {
-
-    @Autowired
-    private NacosRegistration registration;
-
-    @Autowired
-    private NacosAutoServiceRegistration nacosAutoServiceRegistration;
-
-    @Override
-    public void onApplicationEvent(ApplicationReadyEvent event) {
-        String property = event.getApplicationContext().getEnvironment().getProperty("server.port");
-        registration.setPort(Integer.parseInt(property));
-        nacosAutoServiceRegistration.setPort(Integer.parseInt(property));
-        nacosAutoServiceRegistration.start();
-    }
-}

platform-common/src/main/resources/caffeine.properties → platform-api/src/main/resources/caffeine.properties


platform-common/src/main/resources/com/platform/dao/SysConfigDao.xml → platform-api/src/main/resources/com/platform/dao/SysConfigDao.xml


platform-common/src/main/resources/com/platform/dao/SysLogDao.xml → platform-api/src/main/resources/com/platform/dao/SysLogDao.xml


platform-common/src/main/resources/com/platform/dao/SysMacroDao.xml → platform-api/src/main/resources/com/platform/dao/SysMacroDao.xml


platform-common/src/main/resources/com/platform/dao/SysRegionDao.xml → platform-api/src/main/resources/com/platform/dao/SysRegionDao.xml


platform-common/src/main/resources/com/platform/dao/SysRoleMenuDao.xml → platform-api/src/main/resources/com/platform/dao/SysRoleMenuDao.xml


platform-common/src/main/resources/com/platform/dao/SysSmsLogDao.xml → platform-api/src/main/resources/com/platform/dao/SysSmsLogDao.xml


platform-common/src/main/resources/com/platform/dao/SysUserBrandMapper.xml → platform-api/src/main/resources/com/platform/dao/SysUserBrandMapper.xml


platform-common/src/main/resources/com/platform/dao/custom/MySysUserBrandDao.xml → platform-api/src/main/resources/com/platform/dao/custom/MySysUserBrandDao.xml


platform-common/src/main/resources/ehcache.xml → platform-api/src/main/resources/ehcache.xml


platform-common/src/main/resources/j2cache.properties → platform-api/src/main/resources/j2cache.properties


platform-common/src/main/resources/network.xml → platform-api/src/main/resources/network.xml


+ 3 - 1
platform-common/src/main/java/com/platform/cache/RegionCacheUtil.java

@@ -22,7 +22,9 @@ public class RegionCacheUtil implements InitializingBean {
 
     public static void init() {
         SysRegionDao regionDao = SpringContextUtils.getBean(SysRegionDao.class);
-        sysRegionEntityList = regionDao.queryList(new HashMap<String, Object>());
+        if (null != regionDao) {
+            sysRegionEntityList = regionDao.queryList(new HashMap<String, Object>());
+        }
     }
 
     /**