From 0932eecaf1f3126fabc24b9a2d0ed8985af3ff9a Mon Sep 17 00:00:00 2001 From: Wonder Date: Mon, 6 Oct 2025 15:26:23 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20T02/=E6=90=AD=E5=BB=BAeureka-server?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eureka-server/pom.xml | 36 +++++++++++++++++++ .../eurekaserver/EurekaServerApplication.java | 14 ++++++++ .../src/main/resources/application.yml | 15 ++++++++ .../EurekaServerApplicationTest.java | 14 ++++++++ 4 files changed, 79 insertions(+) create mode 100644 eureka-server/pom.xml create mode 100644 eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java create mode 100644 eureka-server/src/main/resources/application.yml create mode 100644 eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java diff --git a/eureka-server/pom.xml b/eureka-server/pom.xml new file mode 100644 index 0000000..1053318 --- /dev/null +++ b/eureka-server/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + cn.hezhaohui + eureka-server + 1.0-SNAPSHOT + + + cn.hezhaohui + spring-cloud-template + 1.0-SNAPSHOT + + + + 21 + 21 + UTF-8 + + + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + + + + org.springframework.boot + spring-boot-starter-test + test + + + + \ No newline at end of file diff --git a/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java b/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java new file mode 100644 index 0000000..ffe9870 --- /dev/null +++ b/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java @@ -0,0 +1,14 @@ +package cn.hezhaohui.eurekaserver; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; + +@SpringBootApplication +@EnableEurekaServer +public class EurekaServerApplication { + public static void main(String[] args) { + SpringApplication.run(EurekaServerApplication.class, args); + } +} diff --git a/eureka-server/src/main/resources/application.yml b/eureka-server/src/main/resources/application.yml new file mode 100644 index 0000000..34aa40f --- /dev/null +++ b/eureka-server/src/main/resources/application.yml @@ -0,0 +1,15 @@ +server: + port: 8761 + +spring: + application: + name: eureka-server + +eureka: + instance: + hostname: localhost + client: + register-with-eureka: false + fetch-registry: false + service-url: + defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ \ No newline at end of file diff --git a/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java b/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java new file mode 100644 index 0000000..a98f688 --- /dev/null +++ b/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java @@ -0,0 +1,14 @@ +package cn.hezhaohui.eurekaserver; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class EurekaServerApplicationTest { + + @Test + void contextLoads() { + + } + +} \ No newline at end of file