提交 ffd60f0b 编写于 作者: Q qinyingjie

fix:config-get模块

上级 a6a3112e
......@@ -31,6 +31,7 @@
<module>springcloud-service-common</module>
<module>springcloud-service-portal</module>
<module>springcloud-service-config</module>
<module>springcloud-service-config-get</module>
<module>springcloud-service-feign</module>
<module>springcloud-service-eureka</module>
</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 @@
<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-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
</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>
<plugins>
......
......@@ -2,10 +2,8 @@ package com.kwan.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableDiscoveryClient
@EnableConfigServer
@SpringBootApplication
public class ConfigApplication {
......
......@@ -9,13 +9,9 @@ spring:
config:
server:
git:
uri: http://gitcode.net/qyj19920704/springcloud-config
searchPaths: config-repo
uri: https://gitcode.net/qyj19920704/springcloud-config.git
search-paths:
- config-repo
username: 13113691357
password: 15671628341qwe
#服务提供者
eureka:
client:
service-url:
defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/
\ No newline at end of file
label: master
\ No newline at end of file
......@@ -30,6 +30,7 @@
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册