Update: T04/搭建service-producer模块
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
package cn.hezhaohui.serviceproducer;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
|
||||
public class ServiceProducerApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServiceProducerApplication.class, args);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package cn.hezhaohui.serviceproducer.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class HealthController {
|
||||
|
||||
@Value("${test.message}")
|
||||
private String testMessage;
|
||||
|
||||
@GetMapping("/health")
|
||||
public String health() {
|
||||
return "Wow, nice to meet you!" + "\n" + testMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
spring:
|
||||
application:
|
||||
name: service-producer
|
||||
cloud:
|
||||
config:
|
||||
uri: http://localhost:8888
|
||||
fail-fast: true
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8761/eureka
|
||||
Reference in New Issue
Block a user