Add common property

This commit is contained in:
woozu.shin 2021-10-18 15:37:27 +09:00
parent c3e6e72e55
commit 1647838182
2 changed files with 15 additions and 1 deletions

View File

@ -1,9 +1,11 @@
package com.kakaoent.cpdd.config.client1.controller;
import com.kakaoent.cpdd.config.client1.configuration.properties.ApiProperties;
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;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@RequestMapping("/api/v1")
@ -12,6 +14,12 @@ public class PropertyAPIController {
private final ApiProperties apiProperties;
@Value("${app1-common-property}")
private String app1CommonProperty;
@Value("${application-common-property}")
private String applicationCommonProperty;
public PropertyAPIController(ApiProperties apiProperties) {
this.apiProperties = apiProperties;
}
@ -26,4 +34,9 @@ public class PropertyAPIController {
return Mono.just(apiProperties.find("point").getUrl());
}
@GetMapping("/commonProperty")
public Flux<String> getCommonProperty() {
return Flux.just(app1CommonProperty, applicationCommonProperty);
}
}

View File

@ -11,7 +11,8 @@ spring:
prod: prod,datasource-prod,redis-prod
config:
import: "optional:configserver:http://localhost:11080"
import: "configserver:http://localhost:11080"
# import: optional:configserver:http://localhost:11080 # can be start up even config server was not found.
logging.level:
org: TRACE