-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigClientApplication.java
More file actions
33 lines (28 loc) · 1007 Bytes
/
ConfigClientApplication.java
File metadata and controls
33 lines (28 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.github.configclient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author dujf
*/
@SpringBootApplication
@RestController
@RefreshScope
@EnableSwagger2
public class ConfigClientApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigClientApplication.class, args);
String line = "============================================";
System.out.println(new StringBuffer(line).append("\n http://localhost:8015 \n").append(line));
}
// @Value("${name}")
private String name;
@GetMapping("/name")
public String getName() {
return name;
}
}