feat: 지비스 토큰 검증 반영

main
kjh 2 months ago
parent 1f5ba00f76
commit 07c9072e47

@ -106,10 +106,11 @@ public class MobilePageController {
* </pre>
*/
@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()
);

@ -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;
}

@ -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);
}
}

Loading…
Cancel
Save