diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricAfterDTO.java b/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricAfterDTO.java deleted file mode 100644 index 6ea4219..0000000 --- a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricAfterDTO.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.eactive.eai.rms.onl.apim.obp; - -import com.eactive.apim.portal.obp.entity.ObpGwMetric; -import com.google.gson.annotations.SerializedName; -import lombok.Data; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -/** - * ObpGwMetric JSON 응답 DTO (after-timeslice 엔드포인트용) - * - *
예시 출력 형식에 맞춤:
- *
- * {
- * "apiId": "1ba56b82-a9c9-41e2-b3ab-ff9377667d56",
- * "apiName": "[해외송금] 가상계좌 입금실패 정보조회",
- * "apiRoutingUri": "/api/obs/remittance/remittancefail*",
- * "httpMethod": "POST",
- * "orgId": "ORG001",
- * "partnerCode": "000008-01",
- * "appId": "APP001",
- * "appKey": "l7xx2fd7efc523794be5a1b126873a5de613",
- * "requestUri": "-1",
- * "timeslice": "2025-12-02T03:00:00.000+0000",
- * "attemptedCount": 3,
- * "completedCount": 3
- * }
- *
- */
-@Data
-public class ObpGwMetricAfterDTO {
-
- private static final DateTimeFormatter ISO8601_MILLIS_FORMATTER =
- DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'");
-
- @SerializedName("apiId")
- private String apiId;
-
- @SerializedName("apiName")
- private String apiName;
-
- @SerializedName("apiRoutingUri")
- private String apiRoutingUri;
-
- @SerializedName("httpMethod")
- private String httpMethod;
-
- @SerializedName("orgId")
- private String orgId;
-
- @SerializedName("partnerCode")
- private String partnerCode;
-
- @SerializedName("appId")
- private String appId;
-
- @SerializedName("appKey")
- private String appKey;
-
- @SerializedName("requestUri")
- private String requestUri;
-
- @SerializedName("timeslice")
- private String timeslice;
-
- @SerializedName("attemptedCount")
- private Long attemptedCount;
-
- @SerializedName("completedCount")
- private Long completedCount;
-
-
- // AS-IS 호환을 위한 필드 (null 값으로 리턴)
- @SerializedName("clusterHostname")
- private String clusterHostname = null;
-
- @SerializedName("apiDatabaseId")
- private Integer apiDatabaseId = null;
-
- @SerializedName("unauthorizedCount")
- private Integer authorizedCount = null;
-
- @SerializedName("backMinTime")
- private Integer backMinTime = null;
-
- @SerializedName("backMaxTime")
- private Integer backMaxTime = null;
-
- @SerializedName("backSumTime")
- private Integer backSumTime = null;
-
- @SerializedName("frontMinTime")
- private Integer frontMinTime = null;
-
- @SerializedName("frontMaxTime")
- private Integer frontMaxTime = null;
-
- @SerializedName("frontSumTime")
- private Integer frontSumTime = null;
-
-
- /**
- * Entity → DTO 변환
- */
- public static ObpGwMetricAfterDTO from(ObpGwMetric entity) {
- ObpGwMetricAfterDTO dto = new ObpGwMetricAfterDTO();
- dto.setApiId(entity.getApiId());
- dto.setApiName(entity.getApiName());
- dto.setApiRoutingUri(entity.getUri());
- dto.setHttpMethod(entity.getMethod());
- dto.setOrgId(entity.getOrgId());
- dto.setPartnerCode(entity.getPartnerCode());
- dto.setAppId(entity.getAppId());
- dto.setAppKey(entity.getClientId());
- dto.setRequestUri(entity.getRequestUri());
- dto.setTimeslice(formatTimeslice(entity.getTimeslice()));
- dto.setAttemptedCount(entity.getAttemptedCount());
- dto.setCompletedCount(entity.getCompletedCount());
-
-
- // 260224 - AS-IS 개발자포탈에서 쓰이던 ID 필드 값 삭제(OBP 디비 필드 형식과 맞지 않음)
- dto.setOrgId(null);
- dto.setAppId(null);
-
- return dto;
- }
-
- /**
- * timeslice를 ISO8601 형식 (밀리초 포함) + UTC 시간대로 변환
- * 예: 2025-12-02T03:00:00.000+0000
- */
- private static String formatTimeslice(LocalDateTime timeslice) {
- if (timeslice == null) return null;
- return timeslice.format(ISO8601_MILLIS_FORMATTER);
- }
-}
diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricController.java b/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricController.java
index 1e2dbdc..7acd524 100644
--- a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricController.java
+++ b/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricController.java
@@ -85,7 +85,7 @@ public class ObpGwMetricController extends BaseRestController {
DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.MONITORING));
// 5. 데이터 조회
- List예시 출력 형식에 맞춤:
+ *
+ * {
+ * "apiId": "1ba56b82-a9c9-41e2-b3ab-ff9377667d56",
+ * "apiName": "[해외송금] 가상계좌 입금실패 정보조회",
+ * "apiRoutingUri": "/api/obs/remittance/remittancefail*",
+ * "httpMethod": "POST",
+ * "orgId": "ORG001",
+ * "partnerCode": "000008-01",
+ * "appId": "APP001",
+ * "appKey": "l7xx2fd7efc523794be5a1b126873a5de613",
+ * "requestUri": "-1",
+ * "timeslice": "2025-12-02T03:00:00.000+0000",
+ * "attemptedCount": 3,
+ * "completedCount": 3
+ * }
+ *
*/
@Data
public class ObpGwMetricDTO {
- private static final DateTimeFormatter ISO8601_FORMATTER =
- DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'+0000'");
+ private static final DateTimeFormatter ISO8601_MILLIS_FORMATTER =
+ DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'+0900'");
- @SerializedName("appKey")
- private String clientId;
-
- @SerializedName("clusterHostname")
- private String hostname;
-
- @SerializedName("timeslice")
- private String timeslice;
+ @SerializedName("apiId")
+ private String apiId;
@SerializedName("apiName")
private String apiName;
@SerializedName("apiRoutingUri")
- private String uri;
+ private String apiRoutingUri;
@SerializedName("httpMethod")
- private String method;
+ private String httpMethod;
+
+ @SerializedName("orgId")
+ private String orgId;
+
+ @SerializedName("partnerCode")
+ private String partnerCode;
+
+ @SerializedName("appId")
+ private String appId;
+
+ @SerializedName("appKey")
+ private String appKey;
+
+ @SerializedName("requestUri")
+ private String requestUri;
+
+ @SerializedName("timeslice")
+ private String timeslice;
@SerializedName("attemptedCount")
private Long attemptedCount;
@@ -41,62 +70,68 @@ public class ObpGwMetricDTO {
@SerializedName("completedCount")
private Long completedCount;
- // EAPIM ID
- @SerializedName("apiIdByEapim")
- private String apiId;
- @SerializedName("appIdByEapim")
- private String appId;
+ // AS-IS 호환을 위한 필드 (null 값으로 리턴)
+ @SerializedName("clusterHostname")
+ private String clusterHostname = null;
- @SerializedName("orgIdByEapim")
- private String orgId;
+ @SerializedName("apiDatabaseId")
+ private Integer apiDatabaseId = null;
- // AS-IS 호환용 필드
- @SerializedName("appId")
- private String appIdByCaPortal;
+ @SerializedName("unauthorizedCount")
+ private Integer authorizedCount = null;
- @SerializedName("portalOrgId")
- private String orgIdByCaPortal;
+ @SerializedName("backMinTime")
+ private Integer backMinTime = null;
- @SerializedName("portalApiId")
- private String apiIdByCaPortal;
+ @SerializedName("backMaxTime")
+ private Integer backMaxTime = null;
- @SerializedName("partnerCode")
- private String partnerCode;
+ @SerializedName("backSumTime")
+ private Integer backSumTime = null;
+
+ @SerializedName("frontMinTime")
+ private Integer frontMinTime = null;
+
+ @SerializedName("frontMaxTime")
+ private Integer frontMaxTime = null;
+
+ @SerializedName("frontSumTime")
+ private Integer frontSumTime = null;
- @SerializedName("apiId")
- private String apiIdByCa;
/**
* Entity → DTO 변환
*/
public static ObpGwMetricDTO from(ObpGwMetric entity) {
ObpGwMetricDTO dto = new ObpGwMetricDTO();
- dto.setClientId(entity.getClientId());
- dto.setHostname(entity.getHostname());
- dto.setTimeslice(formatTimeslice(entity.getTimeslice()));
+ dto.setApiId(entity.getApiId());
dto.setApiName(entity.getApiName());
- dto.setUri(entity.getUri());
- dto.setMethod(entity.getMethod());
+ dto.setApiRoutingUri(entity.getUri());
+ dto.setHttpMethod(entity.getMethod());
+ dto.setOrgId(entity.getOrgId());
+ dto.setPartnerCode(entity.getPartnerCode());
+ dto.setAppId(entity.getAppId());
+ dto.setAppKey(entity.getClientId());
+ dto.setRequestUri(entity.getRequestUri());
+ dto.setTimeslice(formatTimeslice(entity.getTimeslice()));
dto.setAttemptedCount(entity.getAttemptedCount());
dto.setCompletedCount(entity.getCompletedCount());
- dto.setApiId(entity.getApiId());
- dto.setAppId(entity.getAppId());
- dto.setOrgId(entity.getOrgId());
- dto.setAppIdByCaPortal(entity.getAppIdByCaPortal());
- dto.setOrgIdByCaPortal(entity.getOrgIdByCaPortal());
- dto.setApiIdByCaPortal(entity.getApiIdByCaPortal());
- dto.setPartnerCode(entity.getPartnerCode());
- dto.setApiIdByCa(entity.getApiIdByCa());
+
+
+ // 260224 - AS-IS 개발자포탈에서 쓰이던 ID 필드 값 삭제(OBP 디비 필드 형식과 맞지 않음)
+ dto.setOrgId(null);
+ dto.setAppId(null);
+
return dto;
}
/**
- * timeslice를 ISO8601 형식 + UTC 시간대로 변환
- * 예: 2025-12-02T01:00:00+0000
+ * timeslice를 ISO8601 형식 (밀리초 포함) + UTC 시간대로 변환
+ * 예: 2025-12-02T03:00:00.000+0000
*/
private static String formatTimeslice(LocalDateTime timeslice) {
if (timeslice == null) return null;
- return timeslice.format(ISO8601_FORMATTER);
+ return timeslice.format(ISO8601_MILLIS_FORMATTER);
}
}
diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricManService.java b/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricManService.java
index 814f13c..72e5c65 100644
--- a/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricManService.java
+++ b/src/main/java/com/eactive/eai/rms/onl/apim/obp/ObpGwMetricManService.java
@@ -311,30 +311,17 @@ public class ObpGwMetricManService extends BaseService {
return entity;
}
- /**
- * 특정 시간대의 GwMetric 데이터 조회 (REST API용)
- */
- public List