43 lines
1.3 KiB
Java
43 lines
1.3 KiB
Java
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")
|
|
@RestController
|
|
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;
|
|
}
|
|
|
|
@GetMapping("/apis/gateway")
|
|
public Mono<String> getGatewayUrl() {
|
|
return Mono.just(apiProperties.find("gateway").getUrl());
|
|
}
|
|
|
|
@GetMapping("/apis/point")
|
|
public Mono<String> getPointAPIUrl() {
|
|
return Mono.just(apiProperties.find("point").getUrl());
|
|
}
|
|
|
|
@GetMapping("/commonProperty")
|
|
public Flux<String> getCommonProperty() {
|
|
return Flux.just(app1CommonProperty, applicationCommonProperty);
|
|
}
|
|
|
|
}
|