Преглед изворни кода

【优化】 模块启动验证优化

linfutong пре 3 година
родитељ
комит
d2688b3385

+ 0 - 1
zd-gateway/src/main/java/com/zd/gateway/ZdGatewayApplication.java

@@ -21,7 +21,6 @@ public class ZdGatewayApplication {
     static Logger logger = LoggerFactory.getLogger(ZdGatewayApplication.class);
 
     public static void main(String[] args) {
-        //ConfigurableApplicationContext run = SpringApplication.run(ZdGatewayApplication.class, args);
         ConfigurableApplicationContext run = ZdStartApplication.run(ApplicationConstants.GATEWAY_SERVICE, ZdGatewayApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  网关启动成功   ლ(´ڡ`ლ)゙");
 

+ 9 - 9
zd-model/src/main/resources/application.yml

@@ -1,14 +1,14 @@
 #服务器端口
 service:
   port:
-    auth: 9001
     gateway: 8080
-    system: 9011
-    base: 9500
-    airbottle: 9031
-    laboratory: 9041
-    app: 9042
-    chemical: 9050
-    exam: 9051
-    algorithm: 9061
+    auth: 9001
+    system: 9002
+    base: 9003
+    laboratory: 9011
+    chemical: 9012
+    airbottle: 9013
+    exam: 9014
+    algorithm: 9015
+    app: 9021
 

Разлика између датотеке није приказан због своје велике величине
+ 0 - 10
zd-modules/zd-airbottle/Dockerfile


+ 0 - 9
zd-modules/zd-airbottle/pom.xml

@@ -45,13 +45,6 @@
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
 
-        <!-- Swagger UI -->
-<!--        <dependency>-->
-<!--            <groupId>io.springfox</groupId>-->
-<!--            <artifactId>springfox-swagger-ui</artifactId>-->
-<!--            <version>${swagger.fox.version}</version>-->
-<!--        </dependency>-->
-
         <!-- Mysql Connector -->
         <dependency>
             <groupId>mysql</groupId>
@@ -134,8 +127,6 @@
             <groupId>com.zd.airbottle</groupId>
             <artifactId>zd-airbottle-api</artifactId>
         </dependency>
-
-
     </dependencies>
 
     <build>

+ 6 - 2
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/ZdAirbottleApplication.java

@@ -3,8 +3,12 @@ package com.zd.airbottle;
 import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
 import com.zd.common.core.annotation.EnableCustomConfig;
 import com.zd.common.core.annotation.EnableRyFeignClients;
+import com.zd.common.core.launch.ZdStartApplication;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.constant.BaseConstants;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
@@ -18,9 +22,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @EnableScheduling
 @NacosPropertySource(dataId = "zd-airbottle", autoRefreshed = true)
+@ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
 public class ZdAirbottleApplication {
     public static void main(String[] args) {
-        SpringApplication.run(ZdAirbottleApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  气瓶模块启动成功   ლ(´ڡ`ლ)゙");
+        ZdStartApplication.run(ApplicationConstants.BOTTLE_SERVICE, ZdAirbottleApplication.class, args);
     }
 }

+ 2 - 26
zd-modules/zd-airbottle/src/main/resources/bootstrap.yml

@@ -1,34 +1,10 @@
-# Tomcat
 server:
-  port: 9400
-# Spring
-spring:
-  application:
-    # 应用名称
-    name: zd-airbottle
-  profiles:
-    # 环境配置
-    active: dev
-  cloud:
-    nacos:
-      discovery:
-        # 服务注册地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-      config:
-        # 配置中心地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-        # 配置文件格式
-        file-extension: yml
-        # 动态刷新
-        refresh-enabled: true
-        # 共享配置
-        shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+  port: ${service.port.airbottle}
 
 # mybatis配置
 mybatis:
   # 搜索指定包别名
-  typeAliasesPackage: com.zd.airbottle.domain
+  typeAliasesPackage: com.zd.airbottle
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
   mapperLocations: classpath:mapper/**/*.xml
   configuration:

+ 0 - 1
zd-modules/zd-base/src/main/java/com/zd/base/BaseApplicaion.java

@@ -17,7 +17,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @EnableScheduling
 @ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
-@Slf4j
 public class BaseApplicaion {
     public static void main(String[] args) {
         ZdStartApplication.run(ApplicationConstants.BASE_SERVICE, BaseApplicaion.class, args);

+ 1 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/ZdLaboratoryApplication.java

@@ -10,7 +10,7 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
- * 系统模块
+ * 实验室服务
  *
  * @author zd
  */
@@ -21,7 +21,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
 public class ZdLaboratoryApplication {
     public static void main(String[] args) {
-        //SpringApplication.run(ZdLaboratoryApplication.class, args);
         ZdStartApplication.run(ApplicationConstants.LABORATORY_SERVICE, ZdLaboratoryApplication.class, args);
     }
 }