From 5403a855e715aab995eec8658d044e362527fd52 Mon Sep 17 00:00:00 2001 From: houg <hougang_ahut@163.com> Date: Thu, 20 Jun 2019 17:27:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newretail/eureka/TestController.java | 29 ------------------- src/main/resources/application-dev.properties | 3 -- src/main/resources/application.yml | 8 ++--- 3 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/com/enovate/newretail/eureka/TestController.java delete mode 100644 src/main/resources/application-dev.properties diff --git a/src/main/java/com/enovate/newretail/eureka/TestController.java b/src/main/java/com/enovate/newretail/eureka/TestController.java deleted file mode 100644 index ad4a802..0000000 --- a/src/main/java/com/enovate/newretail/eureka/TestController.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.enovate.newretail.eureka; - -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import com.ctrip.framework.apollo.Config; -import com.ctrip.framework.apollo.spring.annotation.ApolloConfig; - -@RestController -@RequestMapping(path = "/config") -public class TestController { - - @ApolloConfig - private Config config; - - - @RequestMapping(path = "/get/{key}", method = {RequestMethod.GET, RequestMethod.POST}) - public String get(@PathVariable("key") String key) { - return config.getProperty(key, config.getSourceType().name()); - } - - @RequestMapping(path = "/value", method = {RequestMethod.GET, RequestMethod.POST}) - public String value() { - return null; - } - -} diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties deleted file mode 100644 index 777f1f0..0000000 --- a/src/main/resources/application-dev.properties +++ /dev/null @@ -1,3 +0,0 @@ - -eureka.instance.hostname=localhost -eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/ \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0d0ec46..1506e05 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,8 @@ spring: application: name: eureka-server + profiles: + active: apollo-env.properties server: port: 8761 servlet: @@ -8,17 +10,13 @@ server: app: id:evonate-newretail-eureka -spring: - profiles: - active: apollo-env.properties - #表示是å¦å°†è‡ªå·±æ³¨å†Œåˆ°Eureka Server上,默认为true eureka: client: registerWithEureka: false #表示是å¦ä»ŽEureka Serverä¸ŠèŽ·å–æ³¨å†Œä¿¡æ¯ï¼Œé»˜è®¤ä¸ºtrue fetchRegistry: false - serviceUrl: + serviceUrl: defaultZone: http://localhost:${server.port}/register/eureka/ instance: hostname: localhost -- 2.18.1