From 39108a447b220c02f794a276739ef7d63685c0bb Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 26 Aug 2024 17:44:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20can(=EC=B2=9C=EC=95=88)=20=EB=AA=A8?= =?UTF-8?q?=EB=B0=94=EC=9D=BC=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/mbl/service/IMobilePageService.java | 4 +- .../biz/mbl/service/MobilePageService.java | 42 +++----- .../xit/biz/mbl/web/MobilePageController.java | 21 ++-- .../kr/xit/biz/mbl/web/TestController.java | 30 ------ .../src/main/webapp/WEB-INF/jsp/error.jsp | 4 +- .../src/main/webapp/WEB-INF/jsp/index.jsp | 99 ------------------- 6 files changed, 32 insertions(+), 168 deletions(-) delete mode 100644 mens-api/src/main/java/kr/xit/biz/mbl/web/TestController.java delete mode 100644 mens-api/src/main/webapp/WEB-INF/jsp/index.jsp diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/service/IMobilePageService.java b/mens-api/src/main/java/kr/xit/biz/mbl/service/IMobilePageService.java index 6a3e687..836acff 100644 --- a/mens-api/src/main/java/kr/xit/biz/mbl/service/IMobilePageService.java +++ b/mens-api/src/main/java/kr/xit/biz/mbl/service/IMobilePageService.java @@ -21,8 +21,8 @@ import kr.xit.core.model.IApiResponse; * */ public interface IMobilePageService { - // FIXME: kakao v1 or v2 - //Map findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO); + // FIXME: kakao v1 or v2 - 천안 jsp에서 호출됨 + String findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO); String findKkotalkReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO); IApiResponse findKtMblPage(final KtTokenConfirmRequest reqDTO); diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java b/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java index cfc10c4..ac0bf5f 100644 --- a/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java +++ b/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java @@ -1,14 +1,8 @@ package kr.xit.biz.mbl.service; -import java.util.Map; - import org.springframework.stereotype.Service; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import kr.xit.biz.ens.model.cntc.CntcDTO; -import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO; import kr.xit.biz.ens.model.kt.KtCommonDTO; import kr.xit.biz.ens.model.kt.KtTokenDTO; import kr.xit.biz.mbl.mapper.IMobilePageMapper; @@ -20,9 +14,7 @@ import kr.xit.core.model.ApiResponseDTO; import kr.xit.core.model.IApiResponse; import kr.xit.core.service.AbstractService; import kr.xit.core.spring.annotation.TraceLogging; -import kr.xit.core.spring.util.MapDeserailizer; import kr.xit.core.support.utils.Checks; -import kr.xit.core.support.utils.JsonUtils; import kr.xit.ens.kakao.v1.service.IKkopayEltrcDocService; import kr.xit.ens.kakao.v2.service.IKkotalkEltrcDocService; import kr.xit.ens.kt.service.IKtBcService; @@ -53,7 +45,6 @@ public class MobilePageService extends AbstractService implements IMobilePageSer private final IKkotalkEltrcDocService kkotalkService; private final IKtBcService ktMmsService; - private Gson gson = new GsonBuilder().registerTypeAdapter(Map.class, new MapDeserailizer()).serializeNulls().create(); /** *
      * 카카오 내문서함 모바일 페이지 컨탠트 요청
@@ -71,7 +62,7 @@ public class MobilePageService extends AbstractService implements IMobilePageSer
      */
     //@Override
     @TraceLogging
-    public Map findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO) {
+    public String findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO) {
 
         if (Checks.isEmpty(reqDTO.getToken()) || Checks.isEmpty(reqDTO.getDocumentBinderUuid()) || Checks.isEmpty(reqDTO.getExternalDocumentUuid()))
             throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
@@ -79,19 +70,20 @@ public class MobilePageService extends AbstractService implements IMobilePageSer
         final MobilePageManage mobilePageManage = mapper.selectKkopayMobilePage(reqDTO);
         if(mobilePageManage == null)    throw BizRuntimeException.create("데이타 오류[카카오페이 내문서함 문서가 없습니다]");
 
-        final ApiResponseDTO res = kkopayService.findKkopayReadyAndMblPage(
-            KkopayDocDTO.OneTimeToken.builder()
-                .document_binder_uuid(reqDTO.getDocumentBinderUuid())
-                .external_document_uuid(reqDTO.getExternalDocumentUuid())
-                .token(reqDTO.getToken())
-                .signguCode(mobilePageManage.getSignguCode())
-                .ffnlgCode(mobilePageManage.getFfnlgCode())
-                .build()
-        );
-        if(!res.isSuccess()){
-            throw BizRuntimeException.create(res.getMessage());
-        }
-        return JsonUtils.toObject(mobilePageManage.getMobilePageCn(), Map.class);
+        // FIXME: 테스트를 위해 임시로 주석처리
+        // final ApiResponseDTO res = kkopayService.findKkopayReadyAndMblPage(
+        //     KkopayDocDTO.OneTimeToken.builder()
+        //         .document_binder_uuid(reqDTO.getDocumentBinderUuid())
+        //         .external_document_uuid(reqDTO.getExternalDocumentUuid())
+        //         .token(reqDTO.getToken())
+        //         .signguCode(mobilePageManage.getSignguCode())
+        //         .ffnlgCode(mobilePageManage.getFfnlgCode())
+        //         .build()
+        // );
+        // if(!res.isSuccess()){
+        //     throw BizRuntimeException.create(res.getMessage());
+        // }
+        return mobilePageManage.getMobilePageCn();
     }
 
     /**
@@ -131,11 +123,7 @@ public class MobilePageService extends AbstractService implements IMobilePageSer
         // if(!res.isSuccess()){
         //     throw BizRuntimeException.create(res.getMessage());
         // }
-        // Map>> map = gson.fromJson(mobilePageManage.getMobilePageCn(), Map.class);
-        // Map>> mobilePage = new HashMap<>();
-        // mobilePage.put("details", map.get("details"));
 
-        //JsonUtils.toObject(mobilePageManage.getMobilePageCn(), Map.class);
         return mobilePageManage.getMobilePageCn();
     }
 
diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java b/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java
index 9350c2c..f9b5b72 100644
--- a/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java
+++ b/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java
@@ -66,16 +66,19 @@ public class MobilePageController {
             throw BizRuntimeException.create("정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
         }
 
-        //if(StringUtils.isNotEmpty(reqDTO.getDocumentBinderUuid())) {
-        //    return service.findKkopayReadyAndMblPage(reqDTO);
-        //}else{
-        //    return service.findKkotalkReadyAndMblPage(reqDTO);
-        //}
         ModelAndView mav = new ModelAndView();
-        mav.setViewName("notiprnt");
-        mav.addObject("errCode", "OK");
-        mav.addObject("errMsg", "정상");
-        mav.addObject("details", service.findKkotalkReadyAndMblPage(reqDTO));
+        mav.setViewName("/notiprnt");
+
+        try {
+            if(StringUtils.isNotEmpty(reqDTO.getDocumentBinderUuid())) {
+                mav.addObject("details", service.findKkopayReadyAndMblPage(reqDTO));
+            }else{
+                mav.addObject("details", service.findKkotalkReadyAndMblPage(reqDTO));;
+            }
+        }catch (Exception e){
+            mav.addObject("errCode", e.getMessage());
+            mav.addObject("errMsg", e.getMessage());
+        }
         return mav;
     }
 
diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/web/TestController.java b/mens-api/src/main/java/kr/xit/biz/mbl/web/TestController.java
deleted file mode 100644
index 89440f1..0000000
--- a/mens-api/src/main/java/kr/xit/biz/mbl/web/TestController.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package kr.xit.biz.mbl.web;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-/**
- * 
- * description : 전자문서 중개자 모바일 페이지 API Controller
- *               - mens-web에서 호출
- * packageName : kr.xit.biz.mbl.web
- * fileName    : MobilePageController
- * author      : limju
- * date        : 2023-08-31
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-08-31    limju       최초 생성
- *
- * 
- */ -@RestController -public class TestController { - - - @RequestMapping(value = "/index") - public ModelAndView test() { - return new ModelAndView("index"); - } -} diff --git a/mens-api/src/main/webapp/WEB-INF/jsp/error.jsp b/mens-api/src/main/webapp/WEB-INF/jsp/error.jsp index 66e01ec..32aecf5 100644 --- a/mens-api/src/main/webapp/WEB-INF/jsp/error.jsp +++ b/mens-api/src/main/webapp/WEB-INF/jsp/error.jsp @@ -1,5 +1,7 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + - + diff --git a/mens-api/src/main/webapp/WEB-INF/jsp/index.jsp b/mens-api/src/main/webapp/WEB-INF/jsp/index.jsp deleted file mode 100644 index 6d56eb6..0000000 --- a/mens-api/src/main/webapp/WEB-INF/jsp/index.jsp +++ /dev/null @@ -1,99 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> - - - - - - - - - - - - <%-- --%> - <%-- --%> - <%-- --%> - - - - - - - - 고지 출력 - - -
-

index.jsp test page

- - - - - - -