refactor: 어플리케이션 업무코드(DAP) 전면 전환에 따른 패키지 및 모듈명 대규모 리팩토링
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BalanceReq {
|
||||
@McpParameter(description = "고객의 계좌번호 (- 제외)", required = true)
|
||||
private String accountNumber;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BalanceRes {
|
||||
private String status;
|
||||
private String message;
|
||||
private String accountNumber;
|
||||
private long balance;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className BillingProcessReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BillingProcessReq {
|
||||
|
||||
@McpParameter(description = "처리할 청구 접수 번호", required = true)
|
||||
private String billingId;
|
||||
|
||||
@McpParameter(description = "심사 승인 여부 (예: APPROVE, REJECT)")
|
||||
private String approvalStatus;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className BillingStatusReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BillingStatusReq {
|
||||
|
||||
@McpParameter(description = "조회할 청구 접수 번호", required = true)
|
||||
private String billingId;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className BondCheckReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BondCheckReq {
|
||||
|
||||
@McpParameter(description = "확인하고자 하는 디지털 증권 발행 금액", required = true)
|
||||
private Long amount;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className BondIssueReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BondIssueReq {
|
||||
|
||||
@McpParameter(description = "발행할 디지털 증권 금액", required = true)
|
||||
private Long amount;
|
||||
|
||||
@McpParameter(description = "발행 대상 계좌 번호", required = true)
|
||||
private String targetAccount;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className ContractDetailReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractDetailReq {
|
||||
|
||||
@McpParameter(description = "고객명", required = true)
|
||||
private String customerName;
|
||||
|
||||
@McpParameter(description = "조회할 계약 번호", required = true)
|
||||
private String contractId;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className ContractStatusReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractStatusReq {
|
||||
|
||||
@McpParameter(description = "고객명", required = true)
|
||||
private String customerName;
|
||||
|
||||
@McpParameter(description = "조회할 계약 번호")
|
||||
private String contractId;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className CustomerDetailReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerDetailReq {
|
||||
|
||||
@McpParameter(description = "고객명", required = true)
|
||||
private String customerName;
|
||||
|
||||
@McpParameter(description = "고객 식별 번호 (CID)")
|
||||
private String customerId;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className CustomerGradeReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerGradeReq {
|
||||
|
||||
@McpParameter(description = "고객 이름 (예: 김신한)", required = true)
|
||||
private String customerName;
|
||||
|
||||
@McpParameter(description = "고객 식별 번호 (CID)")
|
||||
private String customerId;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className LeaveCountReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LeaveCountReq {
|
||||
|
||||
@McpParameter(description = "연차 내역을 조회할 사원 번호", required = true)
|
||||
private String employeeId;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.shinhanlife.glow.GlowMciFieldInfo;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className MciSampleStringRes
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class MciSampleStringRes {
|
||||
@GlowMciFieldInfo(order = 1, length = 10, description = "이름")
|
||||
private String name;
|
||||
|
||||
@GlowMciFieldInfo(order = 2, length = 3, description = "나이")
|
||||
private int age;
|
||||
|
||||
@GlowMciFieldInfo(order = 3, length = 8, description = "가입일자(YYYYMMDD)")
|
||||
private String joinDate;
|
||||
|
||||
@GlowMciFieldInfo(order = 4, length = 2, description = "상태코드")
|
||||
private String statusCode;
|
||||
|
||||
@GlowMciFieldInfo(order = 5, length = 30, description = "타겟 리스트", target = MciSampleTargetDto.class)
|
||||
private List<MciSampleTargetDto> targetList;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import io.shinhanlife.glow.GlowMciFieldInfo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className MciSampleTargetDto
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
*/
|
||||
@Data
|
||||
public class MciSampleTargetDto {
|
||||
@GlowMciFieldInfo(order = 1, length = 5, description = "항목 코드")
|
||||
private String itemCode;
|
||||
|
||||
@GlowMciFieldInfo(order = 2, length = 5, description = "항목 값")
|
||||
private String itemValue;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className SampleStringReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SampleStringReq {
|
||||
private String query;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.shinhanlife.glow.GlowTrgmField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className SampleStringRes
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SampleStringRes {
|
||||
@GlowTrgmField(order = 1, length = 10, description = "이름")
|
||||
private String name;
|
||||
|
||||
@GlowTrgmField(order = 2, length = 3, description = "나이")
|
||||
private int age;
|
||||
|
||||
@GlowTrgmField(order = 3, length = 8, description = "가입일자(YYYYMMDD)")
|
||||
private String joinDate;
|
||||
|
||||
@GlowTrgmField(order = 4, length = 2, description = "상태코드")
|
||||
private String statusCode;
|
||||
|
||||
@GlowTrgmField(order = 5, length = 10, description = "타겟")
|
||||
private String target;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className TemplateDownloadReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@AllArgsConstructor
|
||||
public class TemplateDownloadReq {
|
||||
|
||||
/**
|
||||
* 다운로드할 템플릿의 종류 ID (예: CUSTOMER_EXCEL, PRODUCT_PDF 등)
|
||||
*/
|
||||
private String templateId;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className VacationRegisterReq
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VacationRegisterReq {
|
||||
|
||||
@McpParameter(description = "연차를 등록할 사원 번호", required = true)
|
||||
private String employeeId;
|
||||
|
||||
@McpParameter(description = "휴가 일자 (YYYY-MM-DD 형식)", required = true)
|
||||
private String date;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className WeatherReq
|
||||
* @description 기상 조회 요청 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.07.14
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.14 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public record WeatherReq(
|
||||
@JsonProperty(required = true, value = "city")
|
||||
@JsonPropertyDescription("날씨를 조회할 도시 이름 (예: 서울, 부산, 제주)")
|
||||
String city
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.dto;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.dto
|
||||
* @className WeatherRes
|
||||
* @description 기상 조회 응답 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.07.14
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.14 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public record WeatherRes(
|
||||
String city,
|
||||
double temperature,
|
||||
double windSpeed,
|
||||
String reportTime,
|
||||
String summary
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.other;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
|
||||
@ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
|
||||
@EnableCaching
|
||||
public class AxHubToolOtherApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AxHubToolOtherApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.other.presentation;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.adapter.sender.ShinhanMciSender;
|
||||
import io.shinhanlife.dap.common.integration.mci.dto.MciRequestWrapper;
|
||||
import io.shinhanlife.dap.common.integration.mci.dto.ShinhanCommonHeaderDto;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.other.presentation
|
||||
* @className MciTestController
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/test/mci")
|
||||
@RequiredArgsConstructor
|
||||
public class MciTestController {
|
||||
|
||||
private final ShinhanMciSender shinhanMciSender;
|
||||
|
||||
@Data
|
||||
public static class SampleBizData {
|
||||
private String customerId;
|
||||
private String amount;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@PostMapping("/send")
|
||||
public String testSendMci(HttpServletRequest request, @RequestBody SampleBizData bizData) {
|
||||
try {
|
||||
MciRequestWrapper<SampleBizData> wrapper = new MciRequestWrapper<>();
|
||||
|
||||
ShinhanCommonHeaderDto header = new ShinhanCommonHeaderDto();
|
||||
header.setItrIfId("NCSBACO00001");
|
||||
header.setRcvSvcId("OBACA9040");
|
||||
wrapper.setTgrmCmnnhddValu(header);
|
||||
|
||||
wrapper.setBody(bizData);
|
||||
|
||||
String hostUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
|
||||
String targetUrl = hostUrl + "/api/mock/esb/api"; // 로컬 Mock 서버 URL 호출
|
||||
|
||||
return shinhanMciSender.send(targetUrl, wrapper);
|
||||
|
||||
} catch (Exception e) {
|
||||
return "MCI 전송 실패: " + e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.BalanceReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.service.AbstractMcpToolService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@McpTool(routingType = "MCI", categoryKey = "common")
|
||||
public class BalanceService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "balance 툴", name = "balance",
|
||||
description = "고객의 계좌 잔액을 조회합니다.",
|
||||
prompt = "고객 계좌 잔액을 조회해줘.",
|
||||
mappingId = "ACC_001"
|
||||
)
|
||||
public Object execute(BalanceReq req) {
|
||||
log.info("[Balance] 계좌 잔액 조회 요청 수신. 계좌번호: {}", req.getAccountNumber());
|
||||
|
||||
// 레거시 연동
|
||||
Map<String, Object> result = executeLegacy("MCI", "ACC_001", req);
|
||||
|
||||
// 가짜 데이터 응답 매핑 (AI 에이전트가 그럴듯하게 보여주기 위함)
|
||||
if ("SUCCESS".equals(result.get("status"))) {
|
||||
result.put("accountNumber", req.getAccountNumber());
|
||||
result.put("balance", 1520300); // 1,520,300원 (가상의 잔액)
|
||||
result.put("currency", "KRW");
|
||||
result.put("message", "잔액 조회가 완료되었습니다.");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.BillingStatusReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.BillingProcessReq;
|
||||
|
||||
@McpTool(
|
||||
routingType = "MCI",
|
||||
categoryKey = "claim"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className BillingProcessService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@lombok.extern.slf4j.Slf4j
|
||||
public class BillingProcessService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "status 툴", name = "status", description = "청구심사 상태 조회", prompt = "현재 접수된 청구건 상태를 알려줘.", mappingId = "BILL_001")
|
||||
public Object getStatus(BillingStatusReq data) {
|
||||
return executeBillingLogic("BILL_001", data);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "process 툴", name = "process", description = "청구 처리", prompt = "현재 접수된 청구건에 대한 심사 처리를 진행해.", mappingId = "BILL_002")
|
||||
public Object processBilling(BillingProcessReq data) {
|
||||
return executeBillingLogic("BILL_002", data);
|
||||
}
|
||||
|
||||
private Object executeBillingLogic(String mappingId, Object data) {
|
||||
log.info(" [Billing] 청구 처리 전용 커스텀 전/후처리 로직 수행 시작");
|
||||
|
||||
Map<String, Object> payload;
|
||||
if (data == null) {
|
||||
payload = new HashMap<>();
|
||||
} else {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
payload = mapper.convertValue(data, new TypeReference<Map<String, Object>>() {});
|
||||
}
|
||||
|
||||
// 커스텀 전처리
|
||||
payload.put("custom_injected_data", "Billing System Check OK");
|
||||
log.info(" [Billing] 커스텀 파라미터 주입 완료");
|
||||
|
||||
// 부모 클래스의 레거시 공통 연동 메서드 호출 (PII 마스킹 포함)
|
||||
Map<String, Object> result = executeLegacy("MCI", mappingId, payload);
|
||||
|
||||
// 커스텀 후처리
|
||||
if ("SUCCESS".equals(result.get("status"))) {
|
||||
result.put("billing_custom_insight", "청구 특화 후처리 로직이 적용되었습니다.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.BondCheckReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.BondIssueReq;
|
||||
|
||||
@McpTool(
|
||||
routingType = "EAI",
|
||||
categoryKey = "policy"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className BondIssueService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class BondIssueService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "check 툴", name = "check", register = true, description = "발행 가능 여부 조회 테스트", prompt = "디지털 증권 발행 한도가 충분한지 확인해줘.", mappingId = "BOND_001")
|
||||
public Object check(BondCheckReq data) {
|
||||
return executeLegacy("EAI", "BOND_001", data);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "issue 툴", name = "issue", register = true, description = "증권 발행 테스트1", prompt = "디지털 증권 발행 프로세스를 실행해.", mappingId = "BOND_002")
|
||||
public Object issue(BondIssueReq data) {
|
||||
return executeLegacy("EAI", "BOND_002", data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.VacationRegisterReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.LeaveCountReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.LeaveCountReq;
|
||||
|
||||
@McpTool(
|
||||
routingType = "HTTP",
|
||||
categoryKey = "hr"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className CommonUtilityService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class CommonUtilityService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "register_vacation 툴", name = "register_vacation", description = "휴가 등록", prompt = "내일 하루 연차 휴가를 등록해줘.", mappingId = "HR_VAC_01")
|
||||
public Object registerVacation(VacationRegisterReq data) {
|
||||
return executeLegacy("HTTP", "HR_VAC_01", data);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "get_leave_count 툴", name = "get_leave_count", description = "연차 갯수 조회", prompt = "현재 사용 가능한 남은 연차 일수를 알려줘.", mappingId = "HR_VAC_02")
|
||||
public Object getLeaveCount(LeaveCountReq data) {
|
||||
return executeLegacy("HTTP", "HR_VAC_02", data);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "secret_tool 툴", name = "secret_tool", description = "비공개 툴 테스트", prompt = "숨겨진 툴 강제 호출", mappingId = "SECRET_001", visible = false)
|
||||
public Object secretTool(LeaveCountReq data) {
|
||||
return executeLegacy("HTTP", "SECRET_001", data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.ContractStatusReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.ContractDetailReq;
|
||||
|
||||
@McpTool(
|
||||
routingType = "HTTP",
|
||||
categoryKey = "contract"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className ContractInquiryService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class ContractInquiryService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "contract_status 툴", name = "contract_status", description = "계약상태 조회", prompt = "김신한 고객의 현재 계약 상태를 조회해줘.", mappingId = "CNTR_001")
|
||||
public Object getStatus(ContractStatusReq data) {
|
||||
return executeLegacy("HTTP", "CNTR_001", data);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "contract_detail 툴", name = "contract_detail", description = "계약상세 조회", prompt = "김신한 고객의 계약 상세 내역을 알려줘.", mappingId = "CNTR_002")
|
||||
public Object getDetail(ContractDetailReq data) {
|
||||
return executeLegacy("HTTP", "CNTR_002", data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.CustomerGradeReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.CustomerDetailReq;
|
||||
|
||||
@McpTool(
|
||||
routingType = "TCP",
|
||||
categoryKey = "customer"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className CustomerInfoService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class CustomerInfoService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "grade 툴", name = "grade", description = "고객등급 조회", prompt = "이 고객의 VIP 등급을 조회해줘.", mappingId = "CRM_001")
|
||||
public Object getGrade(CustomerGradeReq req) {
|
||||
return executeLegacy("TCP", "CRM_001", req);
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "detail 툴", name = "detail", description = "고객상세 정보 조회", prompt = "이 고객의 상세 기본정보(주소, 연락처 등)를 알려줘.", mappingId = "CRM_002")
|
||||
public Object getDetail(CustomerDetailReq data) {
|
||||
return executeLegacy("TCP", "CRM_002", data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.MciSampleStringRes;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.SampleStringReq;
|
||||
import io.shinhanlife.glow.util.GlowMciParser;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className SampleStringToolService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service
|
||||
@McpTool(
|
||||
routingType = "MCI",
|
||||
categoryKey = "common"
|
||||
)
|
||||
public class SampleStringToolService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "get_sample_string 툴", name = "get_sample_string",
|
||||
description = "MCI String 버전과 GlowTrgmField 파싱을 테스트하는 샘플 툴입니다.",
|
||||
prompt = "MCI 전문(String) 연계 및 고정 길이 파싱 테스트 해줘.",
|
||||
mappingId = "TRGM_001"
|
||||
)
|
||||
public Object execute(SampleStringReq req) {
|
||||
// 1. EIMS(Legacy)를 통해 원본 고정 길이 문자열을 받아옵니다.
|
||||
// 스펙에 mciFormat = STRING 힌트를 주어 전문 통신으로 자동 분기되게 합니다.
|
||||
List<Map<String, Object>> spec = List.of(
|
||||
Map.of("mciFormat", "STRING")
|
||||
);
|
||||
Map<String, Object> result = executeLegacy("MCI", "TRGM_001", req, spec);
|
||||
|
||||
if (!"SUCCESS".equals(result.get("status"))) {
|
||||
return result;
|
||||
}
|
||||
|
||||
String rawStringResponse = (String) result.get("legacy_response");
|
||||
|
||||
// 2. 받아온 고정 길이 전문(String)을 GlowMciParser를 이용해 DTO로 파싱합니다.
|
||||
return GlowMciParser.parse(rawStringResponse, MciSampleStringRes.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.TemplateDownloadReq;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@McpTool(
|
||||
routingType = "HTTP",
|
||||
categoryKey = "common"
|
||||
)
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className TemplateUtilityService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class TemplateUtilityService extends AbstractMcpToolService {
|
||||
|
||||
@McpFunction(displayName = "get_template_file_url 툴", name = "get_template_file_url",
|
||||
description = "특정 템플릿의 양식 파일(엑셀, 워드 등)을 다운로드 받을 수 있는 시스템 URL을 반환합니다. AI는 이 URL을 사용자에게 마크다운 링크 형태로 제공해야 합니다.",
|
||||
prompt = "요청하신 템플릿 양식 파일 다운로드 URL은 다음과 같습니다. 클릭하여 다운로드하세요:",
|
||||
register = false
|
||||
)
|
||||
public Map<String, Object> getTemplateFileUrl(TemplateDownloadReq data) {
|
||||
try {
|
||||
String templateId = (data != null && data.getTemplateId() != null) ? data.getTemplateId().toLowerCase() : "default";
|
||||
log.info("MCP 툴 호출됨: get_template_file_url, 요청 템플릿 ID: {}", templateId);
|
||||
|
||||
String fileName = "sample_" + templateId + ".xlsx";
|
||||
String downloadUrl = "https://axhub-file-server.shinhanlife.io/downloads/" + fileName;
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("status", "success");
|
||||
|
||||
Map<String, Object> contract = new HashMap<>();
|
||||
contract.put("fileName", fileName);
|
||||
contract.put("downloadUrl", downloadUrl);
|
||||
contract.put("message", "다운로드 링크가 성공적으로 생성되었습니다. AI는 이 링크를 마크다운 형식으로 사용자에게 전달해야 합니다.");
|
||||
contract.put("status", "success");
|
||||
|
||||
result.put("contracts", Collections.singletonList(contract));
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("getTemplateFileUrl 내부 예외 발생", e);
|
||||
throw new RuntimeException("템플릿 URL 생성 실패", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package io.shinhanlife.dap.biz.mcp.tool.service;
|
||||
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.WeatherReq;
|
||||
import io.shinhanlife.dap.biz.mcp.tool.dto.WeatherRes;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestClient;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.biz.mcp.tool.service
|
||||
* @className WeatherToolService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.07.14
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.14 김형식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@McpTool(
|
||||
routingType = "DIRECT",
|
||||
categoryKey = "common"
|
||||
)
|
||||
public class WeatherToolService extends AbstractMcpToolService {
|
||||
|
||||
private final RestClient restClient;
|
||||
|
||||
public WeatherToolService() {
|
||||
this.restClient = RestClient.create();
|
||||
}
|
||||
|
||||
@McpFunction(displayName = "날씨 조회 툴", name = "get_current_weather",
|
||||
description = "특정 도시의 실시간 날씨(기온, 풍속 등)를 오픈 기상 API를 통해 조회합니다.",
|
||||
prompt = "서울 날씨 알려줘, 부산 기온 알려줘 등 실시간 기상 조회",
|
||||
mappingId = "WEATHER_001"
|
||||
)
|
||||
public WeatherRes execute(WeatherReq req) {
|
||||
String city = req.city() != null ? req.city().trim() : "서울";
|
||||
|
||||
// 지역별 위경도 매핑 (간단한 예시)
|
||||
double lat = 37.566;
|
||||
double lon = 126.978;
|
||||
|
||||
if (city.contains("부산")) {
|
||||
lat = 35.179;
|
||||
lon = 129.075;
|
||||
} else if (city.contains("제주")) {
|
||||
lat = 33.499;
|
||||
lon = 126.531;
|
||||
} else if (city.contains("인천")) {
|
||||
lat = 37.456;
|
||||
lon = 126.705;
|
||||
}
|
||||
|
||||
try {
|
||||
String url = String.format("https://api.open-meteo.com/v1/forecast?latitude=%f&longitude=%f¤t_weather=true", lat, lon);
|
||||
|
||||
log.info("[WeatherTool] 날씨 조회 요청 URL: {}", url);
|
||||
|
||||
String responseStr = restClient.get()
|
||||
.uri(url)
|
||||
.retrieve()
|
||||
.body(String.class);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode response = mapper.readTree(responseStr);
|
||||
|
||||
if (response != null && response.has("current_weather")) {
|
||||
JsonNode current = response.get("current_weather");
|
||||
double temp = current.path("temperature").asDouble();
|
||||
double windSpeed = current.path("windspeed").asDouble();
|
||||
String time = current.path("time").asText();
|
||||
|
||||
int weatherCode = current.path("weathercode").asInt();
|
||||
String summary = parseWeatherCode(weatherCode);
|
||||
|
||||
String formattedTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
|
||||
|
||||
return new WeatherRes(city, temp, windSpeed, formattedTime, summary);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("[WeatherTool] 날씨 API 연동 실패: {}", e.getMessage());
|
||||
return new WeatherRes(city, 0.0, 0.0, "", "날씨 정보를 불러오는데 실패했습니다.");
|
||||
}
|
||||
|
||||
return new WeatherRes(city, 0.0, 0.0, "", "알 수 없는 응답입니다.");
|
||||
}
|
||||
|
||||
private String parseWeatherCode(int code) {
|
||||
if (code == 0) return "맑음 (Clear)";
|
||||
if (code >= 1 && code <= 3) return "구름조금/흐림 (Cloudy)";
|
||||
if (code >= 45 && code <= 48) return "안개 (Fog)";
|
||||
if (code >= 51 && code <= 67) return "비/이슬비 (Rain)";
|
||||
if (code >= 71 && code <= 77) return "눈 (Snow)";
|
||||
if (code >= 95) return "뇌우/천둥번개 (Thunderstorm)";
|
||||
return "알 수 없음 (Unknown)";
|
||||
}
|
||||
}
|
||||
21
dap-tool-other/src/main/resources/application-dev.properties
Normal file
21
dap-tool-other/src/main/resources/application-dev.properties
Normal file
@@ -0,0 +1,21 @@
|
||||
# Render 클라우드 환경 전용 설정
|
||||
server.port=${PORT:8084}
|
||||
axhub.gateway.url=https://dap-gateway.onrender.com
|
||||
axhub.tool.url=https://dap-tool-other.onrender.com
|
||||
|
||||
# EIMS 동적 라우팅 접속 정보 (Mock)
|
||||
eims.http.url=http://localhost:${server.port}/api/gateway
|
||||
eims.tcp.host=127.0.0.1
|
||||
eims.tcp.port=8090
|
||||
eims.tcp.timeout=5000
|
||||
eims.jsp.form.url=http://localhost:${server.port}/mock/jsp-form
|
||||
eims.jsp.json.url=http://localhost:${server.port}/mock/jsp-json
|
||||
eims.mci.url=http://localhost:${server.port}/api/mock/esb/api
|
||||
eims.mcistring.url=http://localhost:${server.port}/api/mock/esb/string
|
||||
|
||||
# --- 신한라이프 EAI/MCI 연계 IP 정보 (개발 환경) ---
|
||||
shinhan.integration.envrTypeCd=D
|
||||
shinhan.integration.eai.url=http://10.176.32.181
|
||||
shinhan.integration.internalMci.url=http://10.176.32.173
|
||||
shinhan.integration.bancaMci.url=http://10.176.32.117
|
||||
shinhan.integration.externalMci.url=http://10.176.32.176
|
||||
@@ -0,0 +1,26 @@
|
||||
# Local 환경 전용 설정 (H2 메모리 DB 등)
|
||||
spring.datasource.url=jdbc:p6spy:h2:mem:testdb;DB_CLOSE_DELAY=-1;
|
||||
spring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=password
|
||||
|
||||
spring.h2.console.enabled=true
|
||||
# EIMS 동적 라우팅 접속 정보
|
||||
eims.http.url=http://localhost:${server.port}/api/gateway
|
||||
eims.tcp.host=127.0.0.1
|
||||
eims.tcp.port=8090
|
||||
eims.tcp.timeout=5000
|
||||
eims.jsp.form.url=http://localhost:${server.port}/mock/jsp-form
|
||||
eims.jsp.json.url=http://localhost:${server.port}/mock/jsp-json
|
||||
eims.mci.url=http://localhost:${server.port}/api/mock/esb/api
|
||||
eims.mcistring.url=http://localhost:${server.port}/api/mock/esb/string
|
||||
|
||||
# Gateway/Tool URLs
|
||||
axhub.gateway.url=http://localhost:8081
|
||||
axhub.tool.url=http://localhost:${server.port}
|
||||
|
||||
# Disable Kafka
|
||||
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
|
||||
|
||||
# Suppress Kafka Connection Logs
|
||||
logging.level.org.apache.kafka=ERROR
|
||||
4
dap-tool-other/src/main/resources/application-local.yml
Normal file
4
dap-tool-other/src/main/resources/application-local.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
spring:
|
||||
config:
|
||||
import: "classpath:config/application-glow-local.yml"
|
||||
|
||||
13
dap-tool-other/src/main/resources/application.properties
Normal file
13
dap-tool-other/src/main/resources/application.properties
Normal file
@@ -0,0 +1,13 @@
|
||||
server.port=8084
|
||||
spring.application.name=dap-tool-other
|
||||
|
||||
spring.profiles.active=local
|
||||
|
||||
# Suppress Kafka Connection Logs
|
||||
logging.level.org.apache.kafka=ERROR
|
||||
|
||||
# Auto Prefix Namespace
|
||||
mcp.namespace=other
|
||||
|
||||
# API 보안 키 설정
|
||||
mcp.security.tenant-domains.TESTER-DEV=ALL
|
||||
36
dap-tool-other/src/main/resources/logback-spring.xml
Normal file
36
dap-tool-other/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<!-- 1. 로그 패턴 설정 (MDC traceId 포함) -->
|
||||
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n" />
|
||||
|
||||
<!-- 2. 콘솔(Console) 출력 설정 (로컬 개발용) -->
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>logs/axhub-tool-other.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||
<fileNamePattern>logs/axhub-tool-other-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 4. 기본 로깅 레벨 설정 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="FILE" />
|
||||
</root>
|
||||
|
||||
<!-- 5. 우리 프로젝트 패키지는 디버그 레벨까지 상세히 보기 -->
|
||||
<logger name="io.shinhanlife" level="DEBUG" />
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user