From 07c9072e47b5611445d615ac242bc85c1b7c3035 Mon Sep 17 00:00:00 2001 From: kjh Date: Mon, 2 Sep 2024 18:35:07 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A7=80=EB=B9=84=EC=8A=A4=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EA=B2=80=EC=A6=9D=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/biz/mbl/web/MobilePageController.java | 32 +++++++++++++------ .../main/java/kr/xit/ens/cmm/CmmEnsUtils.java | 5 +-- .../xit/ens/ktgbs/service/KtGbsService.java | 2 +- 3 files changed, 26 insertions(+), 13 deletions(-) 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 a777b55..b453a3b 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 @@ -106,10 +106,11 @@ public class MobilePageController { * */ @Operation(summary = "KT 모바일 데이타 요청(모바일 페이지에서 호출)", description = "KT 모바일 데이타 요청(모바일 페이지에서 호출)") - @PostMapping( + @RequestMapping( value = {"/kt/mblPage/old", "/kt/mblPage/canES", "/kt/mblPage/canWN"}, + method = {RequestMethod.POST, RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) - public ModelAndView findKtMblPage(@RequestParam final String token, final HttpServletRequest request) { + public ModelAndView findKtMblPage(@RequestParam final String token, @RequestParam final String src_key, final HttpServletRequest request) { final String uri = request.getRequestURI(); String mblCnts = ""; @@ -118,33 +119,44 @@ public class MobilePageController { try{ switch (uri) { - case "/kt/mblPage/canES": + case "/api/biz/mbl/kt/mblPage/canES": mblCnts = service.findKtGbsMblPage( KtGbsDTO.TokenConfirmRequest.builder() .signguCode(SignguCode.CHEONAN_ES.getCode()) .ffnlgCode(ApiConstants.FFNLN_CODE) .token(token) + .srcKey(src_key) .build() ); break; - case "/kt/mblPage/canWN": + case "/api/biz/mbl//kt/mblPage/canWN": mblCnts = service.findKtGbsMblPage( KtGbsDTO.TokenConfirmRequest.builder() .signguCode(SignguCode.CHEONAN_WN.getCode()) .ffnlgCode(ApiConstants.FFNLN_CODE) .token(token) + .srcKey(src_key) .build() ); break; - case "/kt/mblPage/old": - //FIXME: KT old mblpage 적용 안됨 - mblCnts = service.findKtBcMblPage( - KtTokenDTO.KtTokenConfirmRequest.builder() - .signguCode("") + case "/api/biz/mbl/kt/mblPage/old": + String signguCode = ""; + if(("CDO01").equals(request.getParameter("service_cd"))){ + signguCode = SignguCode.CHEONAN_ES.getCode(); + } else if(("CSO01").equals(request.getParameter("service_cd"))){ + signguCode = SignguCode.CHEONAN_WN.getCode(); + } else { + throw BizRuntimeException.create(String.format("정상적인 요청이 아닙니다. 요청 url을 확인해 주세요.\n(요청 URL: %s)", uri)); + } + + mblCnts = service.findKtGbsMblPage( + KtGbsDTO.TokenConfirmRequest.builder() + .signguCode(signguCode) .ffnlgCode(ApiConstants.FFNLN_CODE) - .accessToken(token) + .token(token) + .srcKey(src_key) .build() ); diff --git a/mens-api/src/main/java/kr/xit/ens/cmm/CmmEnsUtils.java b/mens-api/src/main/java/kr/xit/ens/cmm/CmmEnsUtils.java index dc9839e..3e7a4a9 100644 --- a/mens-api/src/main/java/kr/xit/ens/cmm/CmmEnsUtils.java +++ b/mens-api/src/main/java/kr/xit/ens/cmm/CmmEnsUtils.java @@ -89,7 +89,8 @@ public class CmmEnsUtils { if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageUtil.getMessage("fail.api.rlaybsnm.info")); // KT인 경우 토큰유효기간 check - if(SndngSeCode.KT_BC.equals(seCode)){ + // FIXME : 지비스의 경우 유효기간 리턴이 없으며 4개월 마다 갱신 + /*if(SndngSeCode.KT_GIBIS.equals(seCode)){ if(StringUtils.isNotEmpty(dto.getKtTokenExpiresIn()) && DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo(dto.getKtTokenExpiresIn()) < 0 @@ -105,7 +106,7 @@ public class CmmEnsUtils { .build() ); return cacheService.getRlaybsnmInfoCache(ensDTO); - } + }*/ return dto; } diff --git a/mens-api/src/main/java/kr/xit/ens/ktgbs/service/KtGbsService.java b/mens-api/src/main/java/kr/xit/ens/ktgbs/service/KtGbsService.java index a5fc34e..86067ac 100644 --- a/mens-api/src/main/java/kr/xit/ens/ktgbs/service/KtGbsService.java +++ b/mens-api/src/main/java/kr/xit/ens/ktgbs/service/KtGbsService.java @@ -157,6 +157,6 @@ public class KtGbsService extends AbstractService implements IKtGbsService { } private CmmEnsRlaybsnmDTO getRlaybsnmInfo(final KtCommonDTO.KtMnsRequest request){ - return CmmEnsUtils.getRlaybsnmInfo(request.getSignguCode(), request.getFfnlgCode(), ApiConstants.SndngSeCode.KT_BC); + return CmmEnsUtils.getRlaybsnmInfo(request.getSignguCode(), request.getFfnlgCode(), ApiConstants.SndngSeCode.KT_GIBIS); } }