This commit is contained in:
parent
51811cee42
commit
2efb93702d
6 changed files with 76 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package ru.spcex.clearing.backendapi.config.element;
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.spcex.clearing.backendapi.security.element.JsConfigSettings;
|
||||
import ru.spcex.clearing.backendapi.security.element.SecuritySettings;
|
||||
import ru.spcex.clearing.platform.messaging.config.element.KafkaConsumerSettings;
|
||||
import ru.spcex.clearing.platform.messaging.config.element.KafkaProducerSettings;
|
||||
|
|
@ -17,6 +18,7 @@ public class BackendApiSettings {
|
|||
private KafkaProducerSettings kafkaProducer;
|
||||
private KafkaConsumerSettings kafkaConsumer;
|
||||
private SecuritySettings security;
|
||||
private JsConfigSettings jsConfig;
|
||||
private String exampleSetting;
|
||||
|
||||
public HazelcastClientParams getHazelcast() {
|
||||
|
|
@ -59,6 +61,14 @@ public class BackendApiSettings {
|
|||
this.security = security;
|
||||
}
|
||||
|
||||
public JsConfigSettings getJsConfig() {
|
||||
return jsConfig;
|
||||
}
|
||||
|
||||
public void setJsConfig(JsConfigSettings jsConfig) {
|
||||
this.jsConfig = jsConfig;
|
||||
}
|
||||
|
||||
public HazelcastClientParams getHazelcastSearch() {
|
||||
return hazelcastSearch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.misc;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.spcex.clearing.backendapi.config.element.BackendApiSettings;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
import ru.spcex.clearing.backendapi.security.element.JsConfigSettings;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/js-config")
|
||||
public class JsConfigController {
|
||||
private final BackendApiSettings backendApiSettings;
|
||||
|
||||
public JsConfigController(BackendApiSettings backendApiSettings) {
|
||||
this.backendApiSettings = backendApiSettings;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get js config.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Map<String, Object> getJsConfig() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
result.put(JsConfigSettings.SERVER_TITLE_PARAM_NAME, backendApiSettings.getJsConfig().getServerTitle());
|
||||
result.put(JsConfigSettings.IS_CENTRAL_COUNTER_PARTY_PARAM_NAME, backendApiSettings.getJsConfig().getCentralCounterParty());
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.misc;
|
||||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.misc;
|
||||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package ru.spcex.clearing.backendapi.security.element;
|
||||
|
||||
public class JsConfigSettings {
|
||||
public final static String SERVER_TITLE_PARAM_NAME = "serverTitle";
|
||||
public final static String IS_CENTRAL_COUNTER_PARTY_PARAM_NAME = "isCentralCounterparty";
|
||||
private String serverTitle;
|
||||
private Boolean isCentralCounterParty;
|
||||
|
||||
public String getServerTitle() {
|
||||
return serverTitle;
|
||||
}
|
||||
|
||||
public void setServerTitle(String serverTitle) {
|
||||
this.serverTitle = serverTitle;
|
||||
}
|
||||
|
||||
public Boolean getCentralCounterParty() {
|
||||
return isCentralCounterParty;
|
||||
}
|
||||
|
||||
public void setCentralCounterParty(Boolean centralCounterParty) {
|
||||
isCentralCounterParty = centralCounterParty;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,9 @@ backend-api.kafka-consumer.auto-offset-reset=latest
|
|||
backend-api.kafka-consumer.linger-ms=1
|
||||
backend-api.kafka-consumer.buffer-memory=33554432
|
||||
backend-api.security.authorization-disabled=false
|
||||
|
||||
backend-api.js-config.server-title=?????? 183
|
||||
backend-api.js-config.is-central-counter-party=true
|
||||
#access logs, sample
|
||||
#server.tomcat.accesslog.directory=logs
|
||||
#server.tomcat.accesslog.enabled=true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue