From 13c954d72ec3952ab50876d9386ca07294320b4f Mon Sep 17 00:00:00 2001 From: chenbingxuan <3581044601@qq.com> Date: Mon, 8 Jan 2024 14:46:41 +0800 Subject: [PATCH] =?UTF-8?q?health=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doctor-modules/doctor-health/pom.xml | 97 +++++++++++++++++++ .../main/java/doctor/HealthApplication.java | 28 ++++++ .../src/main/resources/banner.txt | 10 ++ .../src/main/resources/bootstrap.yml | 27 ++++++ .../src/main/resources/logback.xml | 74 ++++++++++++++ doctor-modules/pom.xml | 1 + pom.xml | 3 +- 7 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 doctor-modules/doctor-health/pom.xml create mode 100644 doctor-modules/doctor-health/src/main/java/doctor/HealthApplication.java create mode 100644 doctor-modules/doctor-health/src/main/resources/banner.txt create mode 100644 doctor-modules/doctor-health/src/main/resources/bootstrap.yml create mode 100644 doctor-modules/doctor-health/src/main/resources/logback.xml diff --git a/doctor-modules/doctor-health/pom.xml b/doctor-modules/doctor-health/pom.xml new file mode 100644 index 0000000..917447d --- /dev/null +++ b/doctor-modules/doctor-health/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + doctor + doctor + 3.6.3 + ../../pom.xml + + + doctor-health + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + doctor + doctor-common-datasource + + + + + doctor + doctor-common-datascope + + + + + doctor + doctor-common-log + + + + + doctor + doctor-common-swagger + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + diff --git a/doctor-modules/doctor-health/src/main/java/doctor/HealthApplication.java b/doctor-modules/doctor-health/src/main/java/doctor/HealthApplication.java new file mode 100644 index 0000000..578bb85 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/HealthApplication.java @@ -0,0 +1,28 @@ +package doctor; + +import doctor.common.security.annotation.EnableCustomConfig; +import doctor.common.security.annotation.EnableRyFeignClients; +import doctor.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +public class HealthApplication { + public static void main(String[] args) + { + SpringApplication.run(HealthApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 健康服务启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/doctor-modules/doctor-health/src/main/resources/banner.txt b/doctor-modules/doctor-health/src/main/resources/banner.txt new file mode 100644 index 0000000..fbd45f5 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _ _ + (_) | | + _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ +| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ +| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | +|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| + __/ | __/ | + |___/ |___/ \ No newline at end of file diff --git a/doctor-modules/doctor-health/src/main/resources/bootstrap.yml b/doctor-modules/doctor-health/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..31e3ecc --- /dev/null +++ b/doctor-modules/doctor-health/src/main/resources/bootstrap.yml @@ -0,0 +1,27 @@ +# Tomcat +server: + port: 9204 + +# Spring +spring: + application: + # 应用名称 + name: doctor-health + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 101.34.77.101:8848 + namespace: 9de208a6-cb30-41ae-a880-78196c99c050 + config: + # 配置中心地址 + server-addr: 101.34.77.101:8848 + namespace: 9de208a6-cb30-41ae-a880-78196c99c050 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/doctor-modules/doctor-health/src/main/resources/logback.xml b/doctor-modules/doctor-health/src/main/resources/logback.xml new file mode 100644 index 0000000..886636e --- /dev/null +++ b/doctor-modules/doctor-health/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doctor-modules/pom.xml b/doctor-modules/pom.xml index dd63e27..33f02ae 100644 --- a/doctor-modules/pom.xml +++ b/doctor-modules/pom.xml @@ -13,6 +13,7 @@ doctor-gen doctor-job doctor-file + doctor-health doctor-modules diff --git a/pom.xml b/pom.xml index 59d562b..a9c3654 100644 --- a/pom.xml +++ b/pom.xml @@ -216,6 +216,7 @@ doctor-modules doctor-api doctor-common + doctor-modules/doctor-health pom @@ -282,4 +283,4 @@ - \ No newline at end of file +