parent
66a70ca5aa
commit
483faf9e31
@ -0,0 +1,35 @@
|
||||
package kr.xit.ens.cmm;
|
||||
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
|
||||
import kr.xit.core.spring.util.ApiSpringUtils;
|
||||
import kr.xit.core.spring.util.CoreSpringUtils;
|
||||
import kr.xit.ens.kt.service.IKtMmsService;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* description :
|
||||
*
|
||||
* packageName : kr.xit.ens.kt.cmm
|
||||
* fileName : CmmKtMmsUtils
|
||||
* author : limju
|
||||
* date : 2023-09-19
|
||||
* ======================================================================
|
||||
* 변경일 변경자 변경 내용
|
||||
* ----------------------------------------------------------------------
|
||||
* 2023-09-19 limju 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class CmmKtMmsUtils {
|
||||
private static final EgovMessageSource messageSource = CoreSpringUtils.getMessageSource();
|
||||
private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService();
|
||||
private static final IKtMmsService ktMmsService = ApiSpringUtils.getKtMmsService();
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
package kr.xit.ens.kt.cmm;
|
||||
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import java.util.Objects;
|
||||
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
|
||||
import kr.xit.biz.common.ApiConstants;
|
||||
import kr.xit.biz.common.ApiConstants.SndngSeCode;
|
||||
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
|
||||
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
|
||||
import kr.xit.core.exception.BizRuntimeException;
|
||||
import kr.xit.core.spring.util.ApiSpringUtils;
|
||||
import kr.xit.core.spring.util.CoreSpringUtils;
|
||||
import kr.xit.core.support.utils.DateUtils;
|
||||
import kr.xit.ens.kt.service.IKtMmsService;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* description :
|
||||
*
|
||||
* packageName : kr.xit.ens.kt.cmm
|
||||
* fileName : CmmKtMmsUtils
|
||||
* author : limju
|
||||
* date : 2023-09-19
|
||||
* ======================================================================
|
||||
* 변경일 변경자 변경 내용
|
||||
* ----------------------------------------------------------------------
|
||||
* 2023-09-19 limju 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class CmmKtMmsUtils {
|
||||
private static final EgovMessageSource messageSource = CoreSpringUtils.getMessageSource();
|
||||
private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService();
|
||||
private static final IKtMmsService ktMmsService = ApiSpringUtils.getKtMmsService();
|
||||
|
||||
/**
|
||||
* KT MMS 인증 정보 조회
|
||||
* @return
|
||||
*/
|
||||
public static CmmEnsRlaybsnmDTO getRlaybsnmInfo(final String signguCode, final String ffnlgCode, final
|
||||
SndngSeCode seCode) {
|
||||
CmmEnsRequestDTO ensDTO = CmmEnsRequestDTO.builder()
|
||||
.signguCode(signguCode)
|
||||
.ffnlgCode(ffnlgCode)
|
||||
.profile(ApiConstants.PROFILE)
|
||||
.build();
|
||||
|
||||
final CmmEnsRlaybsnmDTO dto = cacheService.getRlaybsnmInfoCache(ensDTO);
|
||||
cacheService.logCache();
|
||||
|
||||
if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageSource.getMessage("fail.api.rlaybsnm.info"));
|
||||
|
||||
//TODO :: null인 경우, pplus, kakao인 경우
|
||||
// 토큰 유효기간 체크
|
||||
if(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo(
|
||||
Objects.requireNonNull(dto.getKtTokenExpiresIn(), () -> messageSource.getMessage("fail.api.token.invalid.expired", new String[]{seCode.getDesc()}))) < 0) return dto;
|
||||
|
||||
return dto;
|
||||
/*
|
||||
//TODO :: comment remove after test
|
||||
ktMmsService.requestToken(
|
||||
KtMnsRequest.builder()
|
||||
.signguCode(signguCode)
|
||||
.ffnlgCode(ffnlgCode)
|
||||
.profile(ApiConstants.PROFILE)
|
||||
.build()
|
||||
);
|
||||
return cacheService.getRlaybsnmInfoCache(ensDTO);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue