55 lines
1.9 KiB
Java
55 lines
1.9 KiB
Java
package com.cloudhandson.vpdbackoffice.config;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
/** Product-neutral MCP endpoint labels and tool catalogue configuration. */
|
|
@ConfigurationProperties(prefix = "backoffice.mcp")
|
|
public record McpProperties(
|
|
String publicUrl,
|
|
String serverName,
|
|
String toolName,
|
|
String toolLabel,
|
|
String toolDescription,
|
|
String promptDescription,
|
|
String tools
|
|
) {
|
|
|
|
private static final String DEFAULT_PUBLIC_URL = "/mcp";
|
|
private static final String DEFAULT_SERVER_NAME = "data-ai-backoffice";
|
|
private static final String DEFAULT_TOOL_NAME = "oracle.select_ai.data_text2sql";
|
|
private static final String DEFAULT_TOOL_LABEL = "업무 데이터 Text2SQL";
|
|
private static final String DEFAULT_TOOL_DESCRIPTION =
|
|
"승인된 업무 데이터용 읽기 전용 SELECT/WITH SQL을 생성하고, 검증 후 읽기 전용 "
|
|
+ "트랜잭션에서 실행합니다.";
|
|
private static final String DEFAULT_PROMPT_DESCRIPTION =
|
|
"업무 데이터에서 조회할 내용을 자연어로 입력합니다.";
|
|
|
|
public String resolvedPublicUrl() {
|
|
return requiredOrDefault(publicUrl, DEFAULT_PUBLIC_URL);
|
|
}
|
|
|
|
public String resolvedServerName() {
|
|
return requiredOrDefault(serverName, DEFAULT_SERVER_NAME);
|
|
}
|
|
|
|
public String resolvedToolName() {
|
|
return requiredOrDefault(toolName, DEFAULT_TOOL_NAME);
|
|
}
|
|
|
|
public String resolvedToolLabel() {
|
|
return requiredOrDefault(toolLabel, DEFAULT_TOOL_LABEL);
|
|
}
|
|
|
|
public String resolvedToolDescription() {
|
|
return requiredOrDefault(toolDescription, DEFAULT_TOOL_DESCRIPTION);
|
|
}
|
|
|
|
public String resolvedPromptDescription() {
|
|
return requiredOrDefault(promptDescription, DEFAULT_PROMPT_DESCRIPTION);
|
|
}
|
|
|
|
private String requiredOrDefault(String value, String fallback) {
|
|
return value == null || value.isBlank() ? fallback : value.trim();
|
|
}
|
|
}
|