提交 ffd60f0b 编写于 作者: Q qinyingjie

fix:config-get模块

上级 a6a3112e
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<module>springcloud-service-common</module> <module>springcloud-service-common</module>
<module>springcloud-service-portal</module> <module>springcloud-service-portal</module>
<module>springcloud-service-config</module> <module>springcloud-service-config</module>
<module>springcloud-service-config-get</module>
<module>springcloud-service-feign</module> <module>springcloud-service-feign</module>
<module>springcloud-service-eureka</module> <module>springcloud-service-eureka</module>
</modules> </modules>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.kwan.springcloud</groupId>
<artifactId>springcloud-service-parent</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>springcloud-service-config-get</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springcloud-service-config-get</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.kwan.springcloud</groupId>
<artifactId>springcloud-service-common</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.kwan.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ConfigGetApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigGetApplication.class, args);
}
}
package com.kwan.springcloud.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
class ConfigGetController {
@Value("${from}")
private String from;
@RequestMapping("/from")
public String from() {
return this.from;
}
}
\ No newline at end of file
spring.application.name=didispace
spring.cloud.config.profile=dev
spring.cloud.config.label=master
spring.cloud.config.uri=http://localhost:7001/
server.port=7002
\ No newline at end of file
package com.kwan.springcloud;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PortalApplicationTests {
@Test
void contextLoads() {
}
}
...@@ -14,33 +14,28 @@ ...@@ -14,33 +14,28 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.kwan.springcloud</groupId>
<artifactId>springcloud-service-common</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId> <artifactId>spring-cloud-config-server</artifactId>
<version>1.4.7.RELEASE</version>
</dependency> </dependency>
</dependencies> </dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Hoxton.SR12</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build> <build>
<plugins> <plugins>
......
...@@ -2,10 +2,8 @@ package com.kwan.springcloud; ...@@ -2,10 +2,8 @@ package com.kwan.springcloud;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.config.server.EnableConfigServer; import org.springframework.cloud.config.server.EnableConfigServer;
@EnableDiscoveryClient
@EnableConfigServer @EnableConfigServer
@SpringBootApplication @SpringBootApplication
public class ConfigApplication { public class ConfigApplication {
......
...@@ -9,13 +9,9 @@ spring: ...@@ -9,13 +9,9 @@ spring:
config: config:
server: server:
git: git:
uri: http://gitcode.net/qyj19920704/springcloud-config uri: https://gitcode.net/qyj19920704/springcloud-config.git
searchPaths: config-repo search-paths:
- config-repo
username: 13113691357 username: 13113691357
password: 15671628341qwe password: 15671628341qwe
label: master
#服务提供者 \ No newline at end of file
eureka:
client:
service-url:
defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/
\ No newline at end of file
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册