diff --git a/admin/admin-application/pom.xml b/admin/admin-application/pom.xml index 10b1a2f9e..0a52ffe9d 100644 --- a/admin/admin-application/pom.xml +++ b/admin/admin-application/pom.xml @@ -92,6 +92,27 @@ 1.0-SNAPSHOT + + + + + + + + + + + + + de.codecentric + spring-boot-admin-starter-client + 2.1.3 + + + org.springframework.boot + spring-boot-starter-actuator + + diff --git a/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/AdminApplication.java b/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/AdminApplication.java index 5aeb5de0f..76f90ad1f 100644 --- a/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/AdminApplication.java +++ b/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/AdminApplication.java @@ -2,14 +2,15 @@ package cn.iocoder.mall.admin.application; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.ConfigurableApplicationContext; @SpringBootApplication(scanBasePackages = {"cn.iocoder.mall.admin"}) +//@EnableAdminServer public class AdminApplication { public static void main(String[] args) { - ConfigurableApplicationContext ctx = SpringApplication.run(AdminApplication.class, args); - System.out.println(); // TODO 后面去掉,这里是临时的 + SpringApplication.run(AdminApplication.class, args); +// ConfigurableApplicationContext ctx = +// System.out.println(); // TODO 后面去掉,这里是临时的 } } \ No newline at end of file diff --git a/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/MVCConfiguration.java b/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/MVCConfiguration.java index fe9bebbf4..19806637b 100644 --- a/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/MVCConfiguration.java +++ b/admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/MVCConfiguration.java @@ -26,6 +26,8 @@ public class MVCConfiguration implements WebMvcConfigurer { .excludePathPatterns("/admins/passport/login"); // 排除登陆接口 } + + @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { // 解决 swagger-ui.html 的访问,参考自 https://stackoverflow.com/questions/43545540/swagger-ui-no-mapping-found-for-http-request 解决 diff --git a/admin/admin-application/src/main/resources/application.yaml b/admin/admin-application/src/main/resources/application.yaml index a37e6a54f..68f4f820b 100644 --- a/admin/admin-application/src/main/resources/application.yaml +++ b/admin/admin-application/src/main/resources/application.yaml @@ -1,9 +1,19 @@ spring: application: name: admin-application + boot: + admin: + client: + url: http://127.0.0.1:8080 # server server: port: 18083 servlet: - context-path: /admin-api/ \ No newline at end of file + context-path: /admin-api/ + +management: + endpoints: + web: + exposure: + include: "*" \ No newline at end of file diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class b/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class index 6ddcea436..c107f3b30 100644 Binary files a/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class and b/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class index 1e4f270e0..77088bbde 100644 Binary files a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class index 28657f652..b9d62df2b 100644 Binary files a/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class index 47cd5ff1d..ce1e63786 100644 Binary files a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class differ diff --git a/ops/pom.xml b/ops/pom.xml new file mode 100644 index 000000000..926038ebf --- /dev/null +++ b/ops/pom.xml @@ -0,0 +1,34 @@ + + + + mall-parent + cn.iocoder.mall + 1.0-SNAPSHOT + + 4.0.0 + + ops + + + + + de.codecentric + spring-boot-admin-starter-server + 2.1.3 + + + de.codecentric + spring-boot-admin-server-ui + 2.1.3 + + + + org.springframework.boot + spring-boot-starter-web + + + + + \ No newline at end of file diff --git a/ops/src/main/java/cn/iocoder/mall/ops/OpsApplication.java b/ops/src/main/java/cn/iocoder/mall/ops/OpsApplication.java new file mode 100644 index 000000000..81a335d4c --- /dev/null +++ b/ops/src/main/java/cn/iocoder/mall/ops/OpsApplication.java @@ -0,0 +1,15 @@ +package cn.iocoder.mall.ops; + +import de.codecentric.boot.admin.server.config.EnableAdminServer; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAdminServer +public class OpsApplication { + + public static void main(String[] args) { + SpringApplication.run(OpsApplication.class, args); + } + +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2b71f2742..ad7f52cfe 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,7 @@ user common admin + ops pom