From c0a723538f52609c01b82e11db3ccda934799ed3 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 30 Sep 2024 15:14:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20NICE=20CI=20=EC=86=8C=EC=BC=93=20?= =?UTF-8?q?=ED=86=B5=EC=8B=A0=20=EC=B6=94=EA=B0=80=20=20=20=20=20=20=20-?= =?UTF-8?q?=20=EC=A0=84=EB=AC=B8=20=EC=9D=91=EB=8B=B5=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...NiceCiCommon.java => NiceCiApiCommon.java} | 14 ++++++------ .../{NiceCiDTO.java => NiceCiApiDTO.java} | 22 +++++++++---------- ...NiceCiResult.java => NiceCiApiResult.java} | 12 +++++----- ...storyDTO.java => NiceCiHistoryApiDTO.java} | 22 +++++++++---------- .../modules/nice/service/NiceCiService.java | 22 ++++++++++++------- .../service/support/NiceCiApiService.java | 12 +++++----- .../modules/iup-kkotalk-mapper.xml | 1 - 7 files changed, 55 insertions(+), 50 deletions(-) rename src/main/java/cokr/xit/ens/modules/nice/model/{NiceCiCommon.java => NiceCiApiCommon.java} (96%) rename src/main/java/cokr/xit/ens/modules/nice/model/{NiceCiDTO.java => NiceCiApiDTO.java} (97%) rename src/main/java/cokr/xit/ens/modules/nice/model/{NiceCiResult.java => NiceCiApiResult.java} (97%) rename src/main/java/cokr/xit/ens/modules/nice/model/{NiceCiHistoryDTO.java => NiceCiHistoryApiDTO.java} (96%) diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiCommon.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java similarity index 96% rename from src/main/java/cokr/xit/ens/modules/nice/model/NiceCiCommon.java rename to src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java index 5b5aa89..947f0ea 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiCommon.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java @@ -23,12 +23,12 @@ import lombok.extern.slf4j.*; * * */ -@Schema(name = "NiceCiCommon", description = "NICE CI 전문 공통 DTO") +@Schema(name = "NiceCiApiCommon", description = "NICE CI API 전문 공통 DTO") @Getter @NoArgsConstructor @AllArgsConstructor @Slf4j -public class NiceCiCommon { +public class NiceCiApiCommon { /** *
@@ -198,7 +198,7 @@ public class NiceCiCommon {
         return sb.toString();
     }
 
-    public static NiceCiCommon parse(String tgtString) {
+    public static NiceCiApiCommon parse(String tgtString) {
         final int[] parseLength = {
             9, // 전문그룹코드
             4, // 거래종별코드
@@ -214,7 +214,7 @@ public class NiceCiCommon {
         };
 
         if (StringUtils.isNotBlank(tgtString) && tgtString.length() >= 83) {
-            NiceCiCommon nc = new NiceCiCommon();
+            NiceCiApiCommon nc = new NiceCiApiCommon();
             int idx = 0;
             nc.setGrpCode(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
             tgtString = tgtString.substring(parseLength[idx++]);
@@ -258,7 +258,7 @@ public class NiceCiCommon {
     }
 
     public static void main(String[] args) {
-        NiceCiHistoryDTO.Request nr = new NiceCiHistoryDTO.Request();
+        NiceCiHistoryApiDTO.Request nr = new NiceCiHistoryApiDTO.Request();
         nr.setTrCode("0000006150");
         // // 공통부
         //
@@ -272,7 +272,7 @@ public class NiceCiCommon {
 
 
         // 공통부
-        NiceCiCommon nc = new NiceCiCommon();
+        NiceCiApiCommon nc = new NiceCiApiCommon();
         // nc.setGrpCode("grpCode");
         //nc.setTrType("Type");
         nc.setTrClassification("31895");    // 거래구분
@@ -280,7 +280,7 @@ public class NiceCiCommon {
         nc.setOrgMngNo("0000000103");       // 기관관리번호
         nc.setOrgSndDt("20240919");
 
-        System.out.println(NiceCiCommon.parse(nc.ofString()));
+        System.out.println(NiceCiApiCommon.parse(nc.ofString()));
         //sendNiceSocket();
         //serverSocket();
     }
diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java
similarity index 97%
rename from src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java
rename to src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java
index 1b54b25..a201c74 100644
--- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java
+++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java
@@ -29,9 +29,9 @@ import lombok.*;
  *
  * 
*/ -public class NiceCiDTO { +public class NiceCiApiDTO { - @Schema(name = "Request(Nice CI) DTO", description = "NICE CI 요청 전문 DTO") + @Schema(name = "Request(Nice CI) API DTO", description = "NICE CI API 요청 전문 DTO") @Data @NoArgsConstructor @AllArgsConstructor @@ -61,7 +61,7 @@ public class NiceCiDTO { //---------------------------------------------------------------------------------------------- @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @Valid - NiceCiCommon niceCommon; + NiceCiApiCommon niceCommon; /** *
@@ -351,7 +351,7 @@ public class NiceCiDTO {
         //----------------------------------------------------------------------------------------------
         // 공통부 : 100 자리
         //----------------------------------------------------------------------------------------------
-        NiceCiCommon niceCommon;
+        NiceCiApiCommon niceCommon;
 
         /**
          * 
@@ -445,7 +445,7 @@ public class NiceCiDTO {
         //----------------------------------------------------------------------------------------------
         // 응답반복부 : 110 자리
         //----------------------------------------------------------------------------------------------
-        List niceCiResults = new ArrayList<>();
+        List niceCiResults = new ArrayList<>();
         //----------------------------------------------------------------------------------------------
         // 응답반복부 : 110 자리
         //----------------------------------------------------------------------------------------------
@@ -488,7 +488,7 @@ public class NiceCiDTO {
                 response.setTrCode(StringUtils.left(tgtString, parseLength[idx]));
                 tgtString = tgtString.substring(parseLength[idx++]);
 
-                response.setNiceCommon(NiceCiCommon.parse(tgtString));
+                response.setNiceCommon(NiceCiApiCommon.parse(tgtString));
                 tgtString = tgtString.substring(parseLength[idx++]);
 
                 response.setCommonEmptyField(StringUtils.left(tgtString, parseLength[idx]));
@@ -515,10 +515,10 @@ public class NiceCiDTO {
                 if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
                     int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
                     String finalTgtString = tgtString;
-                    List resResults = IntStream.range(0, repeat)
+                    List resResults = IntStream.range(0, repeat)
                         .mapToObj(i -> {
                             String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength);
-                            return NiceCiResult.parse(currentString);
+                            return NiceCiApiResult.parse(currentString);
                         })
                         .collect(Collectors.toList());
                     response.setNiceCiResults(resResults);
@@ -651,7 +651,7 @@ public class NiceCiDTO {
     }
 
     public static void main(String[] args) {
-        NiceCiDTO.Request ciRequest = new NiceCiDTO.Request();
+        NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request();
         //ciRequest.setTrCode("0000006150");
         // // 공통부
         //
@@ -684,7 +684,7 @@ public class NiceCiDTO {
 
 
         // 공통부
-        NiceCiCommon nc = new NiceCiCommon();
+        NiceCiApiCommon nc = new NiceCiApiCommon();
         // nc.setGrpCode("grpCode");
         //nc.setTrType("Type");
         nc.setTrClassification("31895");    // 거래구분
@@ -716,7 +716,7 @@ public class NiceCiDTO {
             // 응답반복부
             "18401011449211name2                                                001                                        "+
             "19412341234567이름2                                                  1                                          ";
-        NiceCiDTO.Response niceResponse = NiceCiDTO.Response.parse(resStr);
+        NiceCiApiDTO.Response niceResponse = NiceCiApiDTO.Response.parse(resStr);
         System.out.println(niceResponse);
         //sendNiceSocket();
         //serverSocket();
diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiResult.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java
similarity index 97%
rename from src/main/java/cokr/xit/ens/modules/nice/model/NiceCiResult.java
rename to src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java
index 3c95fed..f6b4c7a 100644
--- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiResult.java
+++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java
@@ -20,11 +20,11 @@ import lombok.*;
  *
  * 
*/ -@Schema(name = "NiceCiResult", description = "NICE CI 결과 DTO") +@Schema(name = "NiceCiApiResult", description = "NICE CI API 결과 DTO") @Data @NoArgsConstructor @AllArgsConstructor -public class NiceCiResult { +public class NiceCiApiResult { //------------------------------------------------------------------------------------ // 연락처 이력 조회시만 @@ -252,7 +252,7 @@ public class NiceCiResult { // return sb.toString(); // } - public static NiceCiResult parse(String tgtString) { + public static NiceCiApiResult parse(String tgtString) { // 110 자리 final int[] parseLength = { 1, // 개인.사업자.법인구분 @@ -269,7 +269,7 @@ public class NiceCiResult { }; if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString)%110 == 0) { - NiceCiResult result = new NiceCiResult(); + NiceCiApiResult result = new NiceCiApiResult(); int idx = 0; result.setIdDiv(StringUtils.left(tgtString, parseLength[idx])); @@ -308,7 +308,7 @@ public class NiceCiResult { return null; } - public static NiceCiResult parseHistory(String tgtString) { + public static NiceCiApiResult parseHistory(String tgtString) { // 1150 final int[] parseLength = { 20, // 조회일시 - 이력조회시만 사용 @@ -332,7 +332,7 @@ public class NiceCiResult { }; if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString)%1150 == 0) { - NiceCiResult result = new NiceCiResult(); + NiceCiApiResult result = new NiceCiApiResult(); int idx = 0; // 이력조회시만 사용 //////////////////////////////////////////////////////// diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java similarity index 96% rename from src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java rename to src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java index 080e486..627c438 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java @@ -30,9 +30,9 @@ import lombok.*; * *
*/ -public class NiceCiHistoryDTO { +public class NiceCiHistoryApiDTO { - @Schema(name = "Request(Nice CI History) DTO", description = "NICE CI 이력 요청 전문 DTO") + @Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO") @Data @NoArgsConstructor @AllArgsConstructor @@ -62,7 +62,7 @@ public class NiceCiHistoryDTO { //---------------------------------------------------------------------------------------------- @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @Valid - NiceCiCommon niceCommon; + NiceCiApiCommon niceCommon; /** *
@@ -243,7 +243,7 @@ public class NiceCiHistoryDTO {
         //----------------------------------------------------------------------------------------------
         // 공통부 : 100 자리
         //----------------------------------------------------------------------------------------------
-        NiceCiCommon niceCommon;
+        NiceCiApiCommon niceCommon;
 
         /**
          * 
@@ -298,7 +298,7 @@ public class NiceCiHistoryDTO {
         //----------------------------------------------------------------------------------------------
         // 응답반복부 : 1150 자리
         //----------------------------------------------------------------------------------------------
-        List niceCiResults = new ArrayList<>();
+        List niceCiResults = new ArrayList<>();
         //----------------------------------------------------------------------------------------------
         // 응답반복부 : 1150 자리
         //----------------------------------------------------------------------------------------------
@@ -337,7 +337,7 @@ public class NiceCiHistoryDTO {
                 nr.setTrCode(StringUtils.left(tgtString, parseLength[idx]));
                 tgtString = tgtString.substring(parseLength[idx++]);
 
-                nr.setNiceCommon(NiceCiCommon.parse(tgtString));
+                nr.setNiceCommon(NiceCiApiCommon.parse(tgtString));
                 tgtString = tgtString.substring(parseLength[idx++]);
 
                 nr.setCommonEmptyField(StringUtils.left(tgtString, parseLength[idx]));
@@ -355,10 +355,10 @@ public class NiceCiHistoryDTO {
                 if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
                     int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
                     String finalTgtString = tgtString;
-                    List resResults = IntStream.range(0, repeat)
+                    List resResults = IntStream.range(0, repeat)
                         .mapToObj(i -> {
                             String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength);
-                            return NiceCiResult.parseHistory(currentString);
+                            return NiceCiApiResult.parseHistory(currentString);
                         })
                         .collect(Collectors.toList());
                     nr.setNiceCiResults(resResults);
@@ -374,7 +374,7 @@ public class NiceCiHistoryDTO {
     }
 
     public static void main(String[] args) {
-        NiceCiHistoryDTO.Request ciHisRequest = new NiceCiHistoryDTO.Request();
+        NiceCiHistoryApiDTO.Request ciHisRequest = new NiceCiHistoryApiDTO.Request();
         ciHisRequest.setTrCode("0000006150");
         // // 공통부
         //
@@ -387,7 +387,7 @@ public class NiceCiHistoryDTO {
 
 
         // 공통부
-        NiceCiCommon nc = new NiceCiCommon();
+        NiceCiApiCommon nc = new NiceCiApiCommon();
         // nc.setGrpCode("grpCode");
         //nc.setTrType("Type");
         nc.setTrClassification("31895");    // 거래구분
@@ -408,7 +408,7 @@ public class NiceCiHistoryDTO {
             // 응답반복부
             "18401011449211name2                                                001                                        "+
             "19412341234567이름2                                                  1                                          ";
-        NiceCiHistoryDTO.Response niceResponse = NiceCiHistoryDTO.Response.parse(resStr);
+        NiceCiHistoryApiDTO.Response niceResponse = NiceCiHistoryApiDTO.Response.parse(resStr);
         System.out.println(niceResponse);
         //sendNiceSocket();
         //serverSocket();
diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java
index 330285b..39b63c2 100644
--- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java
+++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java
@@ -58,8 +58,14 @@ public class NiceCiService {
         + "\n"
         + "문의처 : 044-211-3377";
 
+    public EnsResponseVO accept(){
+        return null;
+    }
+
+
+
     public EnsResponseVO requestSendBulk() {
-        NiceCiDTO.Request ciRequest = new NiceCiDTO.Request();
+        NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request();
         //ciRequest.setTrCode("0000006150");
         // // 공통부
         //
@@ -75,7 +81,7 @@ public class NiceCiService {
         // nr.setContactSearchCode("1");
 
         // 공통부
-        NiceCiCommon nc = new NiceCiCommon();
+        NiceCiApiCommon nc = new NiceCiApiCommon();
         // nc.setGrpCode("grpCode");
         //nc.setTrType("Type");
         nc.setTrClassification("31895");    // 거래구분
@@ -83,8 +89,8 @@ public class NiceCiService {
         nc.setOrgMngNo("0000000103");       // 기관관리번호
         nc.setOrgSndDt("20240919");
 
-        NiceCiDTO.QueryRequest qr = new NiceCiDTO.QueryRequest();
-        NiceCiDTO.ButtonRequest br = new NiceCiDTO.ButtonRequest();
+        NiceCiApiDTO.QueryRequest qr = new NiceCiApiDTO.QueryRequest();
+        NiceCiApiDTO.ButtonRequest br = new NiceCiApiDTO.ButtonRequest();
 
         ciRequest.setNiceCommon(nc);
         ciRequest.getQueryRequests().add(qr);
@@ -105,7 +111,7 @@ public class NiceCiService {
     }
 
     public EnsResponseVO findBulkStatus() {
-        NiceCiHistoryDTO.Request ciRequest = new NiceCiHistoryDTO.Request();
+        NiceCiHistoryApiDTO.Request ciRequest = new NiceCiHistoryApiDTO.Request();
         //ciRequest.setTrCode("0000006150");
         // // 공통부
         //
@@ -120,7 +126,7 @@ public class NiceCiService {
         // nr.setContactSearchCode("1");
 
         // 공통부
-        NiceCiCommon nc = new NiceCiCommon();
+        NiceCiApiCommon nc = new NiceCiApiCommon();
         // nc.setGrpCode("grpCode");
         //nc.setTrType("Type");
         nc.setTrClassification("31895");    // 거래구분
@@ -128,8 +134,8 @@ public class NiceCiService {
         nc.setOrgMngNo("0000000103");       // 기관관리번호
         nc.setOrgSndDt("20240919");
 
-        NiceCiDTO.QueryRequest qr = new NiceCiDTO.QueryRequest();
-        NiceCiDTO.ButtonRequest br = new NiceCiDTO.ButtonRequest();
+        NiceCiApiDTO.QueryRequest qr = new NiceCiApiDTO.QueryRequest();
+        NiceCiApiDTO.ButtonRequest br = new NiceCiApiDTO.ButtonRequest();
 
         ciRequest.setNiceCommon(nc);
 
diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java b/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java
index 9c28e33..4e539ef 100644
--- a/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java
+++ b/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java
@@ -50,9 +50,9 @@ public class NiceCiApiService {
 
     private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
 
-    public EnsResponseVO requestSendBulk(final NiceCiDTO.Request reqDTO) {
+    public EnsResponseVO requestSendBulk(final NiceCiApiDTO.Request reqDTO) {
         List errors = new ArrayList<>();
-        final Set> list = validator.validate(reqDTO);
+        final Set> list = validator.validate(reqDTO);
         if (!list.isEmpty()) {
             errors.addAll(list.stream()
                 .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
@@ -80,15 +80,15 @@ public class NiceCiApiService {
                 .errMsg(e.getMessage())
                 .build();
         }
-        NiceCiDTO.Response resDTO = NiceCiDTO.Response.parse(rtnMsg);
+        NiceCiApiDTO.Response resDTO = NiceCiApiDTO.Response.parse(rtnMsg);
         return EnsResponseVO.okBuilder()
             .resultInfo(resDTO)
             .build();
     }
 
-    public EnsResponseVO findBulkStatus(final NiceCiHistoryDTO.Request reqDTO) {
+    public EnsResponseVO findBulkStatus(final NiceCiHistoryApiDTO.Request reqDTO) {
         List errors = new ArrayList<>();
-        final Set> list = validator.validate(reqDTO);
+        final Set> list = validator.validate(reqDTO);
         if (!list.isEmpty()) {
             errors.addAll(list.stream()
                 .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
@@ -116,7 +116,7 @@ public class NiceCiApiService {
                 .errMsg(e.getMessage())
                 .build();
         }
-        NiceCiHistoryDTO.Response resDTO = NiceCiHistoryDTO.Response.parse(rtnMsg);
+        NiceCiHistoryApiDTO.Response resDTO = NiceCiHistoryApiDTO.Response.parse(rtnMsg);
         return EnsResponseVO.okBuilder()
             .resultInfo(resDTO)
             .build();
diff --git a/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml b/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml
index fecb7c1..5252298 100644
--- a/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml
+++ b/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml
@@ -2,7 +2,6 @@
 
 
-