https://github.com/JohntunLiu/course-online
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| @SpringBootApplication
@EnableEurekaServer
@Slf4j
public class EurekaApplication {
// private static final Logger LOG = LoggerFactory.getLogger(EurekaApplication.class);
private static String port2;
//获取port值
@Value("${server.port}")
public String port;
@PostConstruct
public void getPort() {
port2=this.port;
}
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class, args);
log.info("启动成功!!");
log.info("Eureka地址: \thttp://127.0.0.1:"+port2);
}
|