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

- - - - - - -