Bladeren bron

【优化】 exam模块启动验证,已处理ok

linfutong 3 jaren geleden
bovenliggende
commit
09ef7efba8

+ 2 - 38
zd-modules/zd-exam/pom.xml

@@ -37,41 +37,16 @@
             <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>
             <artifactId>mysql-connector-java</artifactId>
         </dependency>
 
-        <!-- zd Common DataSource -->
-        <!--<dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datasource</artifactId>
-        </dependency>
-
-        &lt;!&ndash; zd Common DataScope &ndash;&gt;
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datascope</artifactId>
-        </dependency>
-
-        &lt;!&ndash; zd Common Log &ndash;&gt;
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-log</artifactId>
-        </dependency>-->
-
         <!-- zd Common Swagger -->
         <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
+            <groupId>com.zd.swagger</groupId>
+            <artifactId>common-swagger</artifactId>
         </dependency>
 
         <dependency>
@@ -79,17 +54,6 @@
             <artifactId>jave-all-deps</artifactId>
             <version>3.2.0</version>
         </dependency>
-        <!--<dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.junit.vintage</groupId>
-                    <artifactId>junit-vintage-engine</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>-->
 
         <dependency>
             <groupId>org.springframework</groupId>

+ 7 - 2
zd-modules/zd-exam/src/main/java/com/zd/exam/ZdExamApplication.java

@@ -2,15 +2,20 @@ package com.zd.exam;
 
 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.stereotype.Component;
 
 @EnableCustomConfig
 @EnableRyFeignClients
 @SpringBootApplication
+@ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
 public class ZdExamApplication {
     public static void main(String[] args) {
-        SpringApplication.run(ZdExamApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  考试模块启动成功   ლ(´ڡ`ლ)゙");
+        ZdStartApplication.run(ApplicationConstants.EXAM_SERVICE, ZdExamApplication.class, args);
     }
 }

+ 0 - 1
zd-modules/zd-exam/src/main/java/com/zd/exam/controller/ElAIOController.java

@@ -67,7 +67,6 @@ public class ElAIOController extends BaseController {
         if(id == null){
             return R.fail("ID 不能为空!");
         }
-
         ElCategory elCategory = new ElCategory();
         elCategory.setType(2);
         elCategory.setParentId(id);

+ 2 - 23
zd-modules/zd-exam/src/main/resources/bootstrap.yml

@@ -1,32 +1,11 @@
 # Tomcat
 server:
-  port: 9301
+  port: ${service.port.exam}
 
-# Spring
-spring:
-  application:
-    # 应用名称
-    name: zd-exam
-  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
-        # 共享配置
-        shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
 
 # mybatis配置
 mybatis:
   # 搜索指定包别名
-  typeAliasesPackage: com.zd.system
+  typeAliasesPackage: com.zd.exam
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
   mapperLocations: classpath:mapper/**/*.xml