feat: 지비스 토큰 검증 반영

main
kjh 2 months ago
parent 1f5ba00f76
commit 07c9072e47

@ -106,10 +106,11 @@ public class MobilePageController {
* </pre> * </pre>
*/ */
@Operation(summary = "KT 모바일 데이타 요청(모바일 페이지에서 호출)", description = "KT 모바일 데이타 요청(모바일 페이지에서 호출)") @Operation(summary = "KT 모바일 데이타 요청(모바일 페이지에서 호출)", description = "KT 모바일 데이타 요청(모바일 페이지에서 호출)")
@PostMapping( @RequestMapping(
value = {"/kt/mblPage/old", "/kt/mblPage/canES", "/kt/mblPage/canWN"}, value = {"/kt/mblPage/old", "/kt/mblPage/canES", "/kt/mblPage/canWN"},
method = {RequestMethod.POST, RequestMethod.GET},
produces = MediaType.APPLICATION_JSON_VALUE) 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(); final String uri = request.getRequestURI();
String mblCnts = ""; String mblCnts = "";
@ -118,33 +119,44 @@ public class MobilePageController {
try{ try{
switch (uri) { switch (uri) {
case "/kt/mblPage/canES": case "/api/biz/mbl/kt/mblPage/canES":
mblCnts = service.findKtGbsMblPage( mblCnts = service.findKtGbsMblPage(
KtGbsDTO.TokenConfirmRequest.builder() KtGbsDTO.TokenConfirmRequest.builder()
.signguCode(SignguCode.CHEONAN_ES.getCode()) .signguCode(SignguCode.CHEONAN_ES.getCode())
.ffnlgCode(ApiConstants.FFNLN_CODE) .ffnlgCode(ApiConstants.FFNLN_CODE)
.token(token) .token(token)
.srcKey(src_key)
.build() .build()
); );
break; break;
case "/kt/mblPage/canWN": case "/api/biz/mbl//kt/mblPage/canWN":
mblCnts = service.findKtGbsMblPage( mblCnts = service.findKtGbsMblPage(
KtGbsDTO.TokenConfirmRequest.builder() KtGbsDTO.TokenConfirmRequest.builder()
.signguCode(SignguCode.CHEONAN_WN.getCode()) .signguCode(SignguCode.CHEONAN_WN.getCode())
.ffnlgCode(ApiConstants.FFNLN_CODE) .ffnlgCode(ApiConstants.FFNLN_CODE)
.token(token) .token(token)
.srcKey(src_key)
.build() .build()
); );
break; break;
case "/kt/mblPage/old": case "/api/biz/mbl/kt/mblPage/old":
//FIXME: KT old mblpage 적용 안됨 String signguCode = "";
mblCnts = service.findKtBcMblPage( if(("CDO01").equals(request.getParameter("service_cd"))){
KtTokenDTO.KtTokenConfirmRequest.builder() signguCode = SignguCode.CHEONAN_ES.getCode();
.signguCode("") } 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) .ffnlgCode(ApiConstants.FFNLN_CODE)
.accessToken(token) .token(token)
.srcKey(src_key)
.build() .build()
); );

@ -89,7 +89,8 @@ public class CmmEnsUtils {
if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageUtil.getMessage("fail.api.rlaybsnm.info")); if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageUtil.getMessage("fail.api.rlaybsnm.info"));
// KT인 경우 토큰유효기간 check // KT인 경우 토큰유효기간 check
if(SndngSeCode.KT_BC.equals(seCode)){ // FIXME : 지비스의 경우 유효기간 리턴이 없으며 4개월 마다 갱신
/*if(SndngSeCode.KT_GIBIS.equals(seCode)){
if(StringUtils.isNotEmpty(dto.getKtTokenExpiresIn()) if(StringUtils.isNotEmpty(dto.getKtTokenExpiresIn())
&& DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo(dto.getKtTokenExpiresIn()) < 0 && DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo(dto.getKtTokenExpiresIn()) < 0
@ -105,7 +106,7 @@ public class CmmEnsUtils {
.build() .build()
); );
return cacheService.getRlaybsnmInfoCache(ensDTO); return cacheService.getRlaybsnmInfoCache(ensDTO);
} }*/
return dto; return dto;
} }

@ -157,6 +157,6 @@ public class KtGbsService extends AbstractService implements IKtGbsService {
} }
private CmmEnsRlaybsnmDTO getRlaybsnmInfo(final KtCommonDTO.KtMnsRequest request){ 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);
} }
} }

Loading…
Cancel
Save