feat: KT BC 모바일 페이지 load 반영

dev
gitea-관리자 1 year ago
parent 45af147230
commit 39541f7af4

@ -13,9 +13,13 @@ import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltReqData;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmResponse;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenReadRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
import kr.xit.biz.kt.mapper.IBizKtMmsMapper;
import kr.xit.core.consts.ErrorCode;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.support.utils.Checks;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.ens.kt.service.IKtMmsService;
import lombok.RequiredArgsConstructor;
@ -143,13 +147,29 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
}
@Override
public KtCommonResponse cfmToken(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
//final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
//CmmEnsUtils.validate(reqDTO);
public String findKtMblData(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
if (Checks.isEmpty(reqDTO.getAccessToken()))
throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
return null;
KtTokenConfirmResponse cfmRes = ktMmsService.cfmToken(reqDTO);
if(cfmRes.getResultCd().equals("00")){
KtCommonResponse readRes = ktMmsService.readToken(
KtTokenReadRequest.builder()
.accessToken(reqDTO.getAccessToken())
.build()
);
if(readRes.getResultCd().equals("00")){
String srcKey = cfmRes.getSrcKey();
//TODO:: srckey로 컨텐츠 조회후 결과 return
return null;
}
//List<ErrorMsg> errorMsgs = readRes.getErrors();
//String.join(",", Arrays.stream(errorMsgs).toArray())
throw BizRuntimeException.create("~~~~열람확인 오류~~~~");
}
throw BizRuntimeException.create("~~~~토큰인증확인 오류~~~~");
}
@Override

@ -27,7 +27,7 @@ public interface IBizKtMmsService {
KtTokenResponse requestToken(final KtMnsRequest paramDTO);
KtCommonResponse mainSend(final KtMnsRequest reqDTO);
KtCommonResponse cfmToken(final KtTokenConfirmRequest reqDTO);
String findKtMblData(final KtTokenConfirmRequest reqDTO);
KtCommonResponse messageResult(final KtMnsRequest reqDTO);

@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtMnsRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmRequest;
@ -115,14 +117,31 @@ public class BizKtMmsController {
@Operation(summary = "토큰인증확인 조회", description = "토큰인증확인조회요청(BC-AG-SN-008)")
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/cfmToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse cfmToken(@RequestBody final KtTokenConfirmRequest reqDTO) {
//public IApiResponse cfmToken(@RequestBody final Map<String,Object> reqDTO) {
KtCommonResponse dto = service.cfmToken(reqDTO);
return ApiResponseDTO.success(dto);
@Operation(summary = "토큰인증확인 조회(교통시설처)", description = "토큰인증확인조회요청(BC-AG-SN-008)-교통시설처")
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/cfmTokenDp", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse cfmTokenDp(@RequestBody final String token) {
String mblData = service.findKtMblData(
KtTokenConfirmRequest.builder()
.signguCode(SignguCode.TRAFFIC.getCode())
.ffnlgCode(ApiConstants.FFNLN_CODE)
.accessToken(token)
.build()
);
return ApiResponseDTO.success(mblData);
}
@Operation(summary = "토큰인증확인 조회(승화원)", description = "토큰인증확인조회요청(BC-AG-SN-008)-승화원")
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/cfmTokenMe", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse cfmTokenMe(@RequestBody final String token) {
String mblData = service.findKtMblData(
KtTokenConfirmRequest.builder()
.signguCode(SignguCode.FUNERAL.getCode())
.ffnlgCode(ApiConstants.FFNLN_CODE)
.accessToken(token)
.build()
);
return ApiResponseDTO.success(mblData);
}
//
// /*

@ -23,6 +23,7 @@ import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtBefSendRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmResponse;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenExcaRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenReadRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
@ -49,7 +50,7 @@ public interface IKtMmsService {
//------------------------------------------------------------------------------
KtTokenResponse requestToken(final KtMnsRequest paramDTO);
KtCommonResponse mainSend(final KtMainSendRequest reqDTO);
KtCommonResponse cfmToken(final KtTokenConfirmRequest reqDTO);
KtTokenConfirmResponse cfmToken(final KtTokenConfirmRequest reqDTO);
KtCommonResponse readToken(final KtTokenReadRequest reqDTO);
KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO);
//------------------------------------------------------------------------------

@ -25,6 +25,7 @@ import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtBefSendRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmResponse;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenExcaRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenReadRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenRequest;
@ -220,11 +221,10 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
@Override
@TraceLogging
public KtCommonResponse cfmToken(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
public KtTokenConfirmResponse cfmToken(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setAccessToken(ktMnsInfo.getKtAccessToken());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
@ -234,7 +234,7 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
HOST + API_CFM_TOKEN,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
KtTokenConfirmResponse.class,
ktMnsInfo
);
}
@ -245,7 +245,6 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setAccessToken(ktMnsInfo.getKtAccessToken());
reqDTO.setMmsRdgTmst(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"));
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);

@ -57,7 +57,7 @@ contract:
# 사전/본 문자 발송/수신 결과 전송 : BC-AG-SN-010
result-message: /api/ag/message/result
# 토큰인증확인 : 본문자수신등록 callback url
dp-callback-url: http://211.119.124.7:8081/api/biz/kt/v1/cfmTokenDP
dp-callback-url: http://211.119.124.7:8081/api/biz/kt/v1/cfmTokenDp
me-callback-url: http://211.119.124.7:8081/api/biz/kt/v1/cfmTokenMe
# 사전문자수신등록 : BC-AG-SN-001

@ -21,6 +21,8 @@ import lombok.Getter;
*/
public class ApiConstants {
public static final String FFNLN_CODE = "11";
/**
* <pre>
*

@ -27,7 +27,7 @@ import org.hibernate.validator.constraints.NotEmpty;
* Response: {@link KtTokenResponse}
* - Token (BC-AG-SN-008)
* Request: {@link KtTokenConfirmRequest}
* Response: {@link KtCommonResponse}
* Response: {@link KtTokenConfirmResponse}
* - (BC-AG-SN-009)
* Request : {@link KtTokenReadRequest}
* Response : {@link KtCommonResponse}
@ -178,7 +178,7 @@ public class KtTokenDTO {
* <pre>
* Token : BC-AG-SN-008
* Request : KtTokenConfirmRequest
* Response : KtCommonResponse
* Response : KtTokenConfirmResponse
* </pre>
*/
@Schema(name = "KtTokenConfirmRequest", description = "KT 토큰 인증 확인 요청 DTO")
@ -218,7 +218,23 @@ public class KtTokenDTO {
@NotEmpty(message = "토큰은 필수 입니다")
private String accessToken;
}
//----------------------------------------------------------------------------------------
@Schema(name = "KtTokenConfirmResponse", description = "KT 토큰 인증 확인 요청 결과 DTO")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public static class KtTokenConfirmResponse extends KtCommonResponse {
/**
* <pre>
* : Unique - max 50
* </pre>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "관리키")
private String srcKey;
}
/**
* <pre>

Loading…
Cancel
Save