feat: KT, Nice API 반영

dev
gitea-관리자 1 year ago
parent b6c55c7b21
commit 5022d330d7

@ -1,6 +1,7 @@
package kr.xit.biz.kt.service;
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtMnsRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
@ -62,7 +63,13 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
.ktTokenJti(resDTO.getJti())
.build()
);
cacheService.removeRlaybsnmInfoCache(paramDTO);
cacheService.removeRlaybsnmInfoCache(
CmmEnsRequestDTO.builder()
.signguCode(paramDTO.getSignguCode())
.ffnlgCode(paramDTO.getFfnlgCode())
.profile(paramDTO.getProfile())
.build()
);
return resDTO;
}

@ -81,14 +81,9 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
@Override
public NiceTokenResponse generateToken(final NiceCiRequest reqDTO){
final NiceCiInfo niceDTO = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
//FIXME:: nice CI 연계후 제거
NiceTokenResponse tokenResponse = null;
if(isDummy) tokenResponse = dummyTestService.generateToken();
else tokenResponse = niceCiService.generateToken(reqDTO);
final NiceTokenResponse tokenResponse = niceCiService.generateToken(reqDTO);
final ResponseDataHeader dataHeader = tokenResponse.getDataHeader();
if(dataHeader.getGwRsltCd().equals("1200")){
TokenResDataBody dataBody = tokenResponse.getDataBody();
NiceCiInfo dto = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
@ -139,8 +134,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
@Override
public TokenRevokeResponse revokeToken(final NiceCiRequest reqDTO){
final NiceCiInfo dto = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
if(isDummy) return dummyTestService.revokeToken();
else return niceCiService.revokeToken(reqDTO);
return niceCiService.revokeToken(reqDTO);
}
//--------------------------------------------------------------------------------
@ -164,11 +158,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
@Override
public PublickeyResponse requestPublickey(final NiceCiRequest reqDTO) {
final NiceCiInfo niceDTO = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
//FIXME:: nice CI 연계후 제거
PublickeyResponse pubResDTO = null;
if(isDummy) pubResDTO = dummyTestService.requestPublickey();
else pubResDTO = niceCiService.requestPublickey(CmmEnsUtils.generateLengthUuid(24), niceDTO);
final PublickeyResponse pubResDTO = niceCiService.requestPublickey(CmmEnsUtils.generateLengthUuid(24), niceDTO);
//FIXME::공개키 정보 갱신 - Error code enum 전환
final ResponseDataHeader dataHeader = pubResDTO.getDataHeader();
@ -241,10 +231,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
final NiceCiInfo niceDTO = CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO);
final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo(niceDTO.getSiteCode());
SymmetrickeyResponse symResDTO = null;
if(isDummy) symResDTO = dummyTestService.requestRegSymmetrickey(reqDTO);
else symResDTO = niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), symkeyRegInfo, niceDTO);
SymmetrickeyResponse symResDTO = niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), symkeyRegInfo, niceDTO);
final ResponseDataHeader dataHeader = symResDTO.getDataHeader();
final SymmetrickeyResDataBody dataBody = symResDTO.getDataBody();
@ -314,10 +301,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
.clientIp(IpMacUtils.getIpAddress().get(0))
.build();
IpinCiResponse ipinCiResponse = null;
if(isDummy) ipinCiResponse = dummyTestService.requestCi(encDataDTO, niceDTO);
else ipinCiResponse = niceCiService.requestCi(CmmEnsUtils.generateLengthUuid(24), encDataDTO, niceDTO);
IpinCiResponse ipinCiResponse = niceCiService.requestCi(CmmEnsUtils.generateLengthUuid(24), encDataDTO, niceDTO);
ResponseDataHeader resHeader = ipinCiResponse.getDataHeader();
IpinCiResDataBody resBody = ipinCiResponse.getDataBody();

@ -1,31 +1,30 @@
package kr.xit.ens.kt.service;
import kr.xit.biz.ens.model.kt.KtAcmdDTO;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfResponse;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoResponse;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoCfmRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoCfmResponse;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdInfoResponse;
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.KtExcaDTO.KtExcaRequest;
import kr.xit.biz.ens.model.kt.KtExcaDTO.KtExcaResponse;
import kr.xit.biz.ens.model.kt.KtInputDTO.KtRefuseRcvRequest;
import kr.xit.biz.ens.model.kt.KtInputDTO.KtApproveRcvRequest;
import kr.xit.biz.ens.model.kt.KtInputDTO.KtRefuseRcvRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtBlacklistRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcDtlRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcDtlResponse;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcResponse;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtBlacklistRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcResponse;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtWhitelistRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
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.KtTokenExcaRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenReadRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
@ -45,14 +44,23 @@ import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
* </pre>
*/
public interface IKtMmsService {
//------------------------------------------------------------------------------
// mens 사용 API
//------------------------------------------------------------------------------
KtTokenResponse requestToken(final KtMnsRequest paramDTO);
KtCommonResponse beforeSend(final KtBefSendRequest reqDTO);
KtCommonResponse mainSend(final KtMainSendRequest reqDTO);
KtCommonResponse blacklist(final KtBlacklistRequest reqDTO);
KtCommonResponse cfmToken(final KtTokenConfirmRequest reqDTO);
KtCommonResponse readToken(final KtTokenReadRequest reqDTO);
KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// mens 미사용 API
//------------------------------------------------------------------------------
KtCommonResponse beforeSend(final KtBefSendRequest reqDTO);
KtCommonResponse blacklist(final KtBlacklistRequest reqDTO);
KtSendSttcResponse sendSttc(final KtSendSttcRequest reqDTO);
KtSendSttcDtlResponse sendSttcDtl(final KtSendSttcDtlRequest reqDTO);
KtCommonResponse whitelist(final KtWhitelistRequest reqDTO);
@ -66,4 +74,5 @@ public interface IKtMmsService {
KtExcaResponse exca(final KtExcaRequest reqDTO);
KtAcmdInfoResponse infoAcmd(final KtAcmdInfoRequest reqDTO);
KtAcmdInfoCfmResponse cfmAcmd(final KtAcmdInfoCfmRequest reqDTO);
//------------------------------------------------------------------------------
}

@ -30,6 +30,7 @@ import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenReadRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.cmm.CmmEnsUtils;
import kr.xit.ens.kt.cmm.CmmKtMmsUtils;
@ -150,9 +151,10 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
private final ApiWebClientUtil webClient;
/**
*
*/
//------------------------------------------------------------------------------
// mens 사용 API
//------------------------------------------------------------------------------
@Override
public KtTokenResponse requestToken(final KtMnsRequest paramDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(paramDTO.getSignguCode(), paramDTO.getFfnlgCode());
@ -177,14 +179,9 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
);
}
/**
* (BC-AG-SN-001)
* @param reqDTO
*/
@Override
public KtCommonResponse beforeSend(final KtBefSendRequest reqDTO) {
public KtCommonResponse mainSend(final KtMainSendRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setSignguCode(null);
@ -193,38 +190,27 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_BEFORE_SEND,
HOST + API_MAIN_SEND,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
ktMnsInfo
);
/*List<ErrorMsg> errors = new ArrayList<>();
errors.add(new ErrorMsg("error1"));
errors.add(new ErrorMsg("error2"));
return KtCommonResponse.builder()
.resultCd("00")
.resultDt(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"))
.errors(errors)
.build();*/
}
@Override
public KtCommonResponse mainSend(final KtMainSendRequest reqDTO) {
public KtCommonResponse cfmToken(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setAccessToken(ktMnsInfo.getKtAccessToken());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_MAIN_SEND,
HOST + API_CFM_TOKEN,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
@ -233,14 +219,19 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
}
@Override
public KtCommonResponse blacklist(final KtBlacklistRequest reqDTO) {
public KtCommonResponse readToken(final KtTokenReadRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setAccessToken(ktMnsInfo.getKtAccessToken());
reqDTO.setMmsRdgTmst(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"));
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_BLACKLIST,
HOST + API_READ_TOKEN,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
@ -249,30 +240,47 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
}
@Override
public KtCommonResponse cfmToken(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
public KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_CFM_TOKEN,
HOST + API_RESULT_MESSAGE,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
ktMnsInfo
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// mens 미사용 API
//------------------------------------------------------------------------------
/**
* (BC-AG-SN-001)
* @param reqDTO
*/
@Override
public KtCommonResponse readToken(final KtTokenReadRequest reqDTO) {
public KtCommonResponse beforeSend(final KtBefSendRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setServiceKey(ktMnsInfo.getKtSvcCerfKey());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_READ_TOKEN,
HOST + API_BEFORE_SEND,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
@ -281,14 +289,14 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
}
@Override
public KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO) {
public KtCommonResponse blacklist(final KtBlacklistRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
//reqDTO.setServiceCd(ktMnsInfo.get);
//reqDTO.setServiceKey(ktMnsInfo.get);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_RESULT_MESSAGE,
HOST + API_BLACKLIST,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
@ -449,4 +457,5 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
ktMnsInfo
);
}
//------------------------------------------------------------------------------
}

@ -58,51 +58,15 @@ public class KtMmsController {
private final IKtMmsService service;
private final ICmmEnsCacheService ensCacheService;
//------------------------------------------------------------------------------
// mens 사용 API
//------------------------------------------------------------------------------
@Operation(summary = "기관용 토큰 발급 요청", description = "기관용 토큰 발급 요청")
@PostMapping(value = "/requestToken", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestToken(@RequestBody final KtMnsRequest paramDTO) {
return ApiResponseDTO.success(service.requestToken(paramDTO));
}
/*
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
value = """
{
"signguCode": "",
"ffnlgCode": "11",
"service_cd": "NPS",
"service_key": "A3AD41349D759DD3",
"msg_cd": "10006",
"msg_type": "2",
"make_dt": "20211229102000",
"sndn_ex_time": "20211229180000",
"sndn_tot_cnt": 1,
"reqs": [
{
"src_key": "S20211229102000001",
"src_seq": "1",
"ci": "gdlIa53FZGQz5aKa3wLk33nW57N3mDpcwHytWlWMhzxHKulk7EZs143442394326642342364238648423864237",
"mdn": "01011112222", "rcve_rf_str":" ○ 수신거부 및 수신 휴대폰 지정하기 :"
}
],
"opt_type": "2",
"mktn_rcve_csyn": "N",
"m_type": "2"
}
""")
})
})*/
@Operation(summary = "사전 문자 수신 등록 요청", description = "사전 문자 수신 등록 요청(BC-AG-SN-001)")
@PostMapping(value = "/beforeSend", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> beforeSend(@RequestBody final KtBefSendRequest reqDTO) {
KtCommonResponse dto = service.beforeSend(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "본문자 수신 등록 요청", description = "본문자 수신 등록 요청(BC-AG-SN-002)")
@PostMapping(value = "/mainSend", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> mainSend(@RequestBody final KtMainSendRequest reqDTO) {
@ -110,13 +74,6 @@ public class KtMmsController {
return ApiResponseDTO.success(dto);
}
@Operation(summary = "수신 거부 등록 요청", description = "수신 거부 등록 요청(BC-AG-SN-007)")
@PostMapping(value = "/blacklist", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> blacklist(@RequestBody final KtBlacklistRequest reqDTO) {
KtCommonResponse dto = service.blacklist(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "토큰인증확인 조회", description = "토큰인증확인조회요청(BC-AG-SN-008)")
@PostMapping(value = "/cfmToken", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> cfmToken(@RequestBody final KtTokenConfirmRequest reqDTO) {
@ -137,74 +94,101 @@ public class KtMmsController {
KtCommonResponse dto = service.messageResult(reqDTO);
return ApiResponseDTO.success(dto);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// mens 미사용 API
//------------------------------------------------------------------------------
@Operation(hidden = true, summary = "사전 문자 수신 등록 요청", description = "사전 문자 수신 등록 요청(BC-AG-SN-001)")
@PostMapping(value = "/beforeSend", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> beforeSend(@RequestBody final KtBefSendRequest reqDTO) {
KtCommonResponse dto = service.beforeSend(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(hidden = true, summary = "수신 거부 등록 요청", description = "수신 거부 등록 요청(BC-AG-SN-007)")
@PostMapping(value = "/blacklist", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> blacklist(@RequestBody final KtBlacklistRequest reqDTO) {
KtCommonResponse dto = service.blacklist(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "백오피스 발송 통계 연계 조회 요청", description = "백오피스 발송 통계 연계 조회 요청(BC-AG-SN-011)")
@Operation(hidden = true, summary = "백오피스 발송 통계 연계 조회 요청", description = "백오피스 발송 통계 연계 조회 요청(BC-AG-SN-011)")
@PostMapping(value = "/sendSttc", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> sendSttc(@RequestBody final KtSendSttcRequest reqDTO) {
KtMmsDTO.KtSendSttcResponse dto = service.sendSttc(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "백오피스 발송 결과 연계 조회 요청", description = "백오피스 발송 결과 연계 조회 요청(BC-AG-SN-012)")
@Operation(hidden = true, summary = "백오피스 발송 결과 연계 조회 요청", description = "백오피스 발송 결과 연계 조회 요청(BC-AG-SN-012)")
@PostMapping(value = "/sendSttcDtl", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> sendSttcDtl(@RequestBody final KtSendSttcDtlRequest reqDTO) {
KtMmsDTO.KtSendSttcDtlResponse dto = service.sendSttcDtl(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "whitelist 등록 요청", description = "whitelist 등록 요청(BC-AG-SN-013)")
@Operation(hidden = true, summary = "whitelist 등록 요청", description = "whitelist 등록 요청(BC-AG-SN-013)")
@PostMapping(value = "/whitelist", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> whitelist(@RequestBody final KtWhitelistRequest reqDTO) {
KtCommonResponse dto = service.whitelist(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "수신거부상태 전송", description = "수신거부상태전송(BC-AG-SN-014)")
@Operation(hidden = true, summary = "수신거부상태 전송", description = "수신거부상태전송(BC-AG-SN-014)")
@PostMapping(value = "/refuseRcv", produces = MediaType.APPLICATION_JSON_VALUE)
public KtCommonResponse refuseRcv(@RequestBody final KtRefuseRcvRequest reqDTO) {
KtCommonResponse dto = service.refuseRcv(reqDTO);
return dto;
}
@Operation(summary = "수신동의상태 전송", description = "수신동의상태전송(BC-AG-SN-015)")
@Operation(hidden = true, summary = "수신동의상태 전송", description = "수신동의상태전송(BC-AG-SN-015)")
@PostMapping(value = "/approveRcv", produces = MediaType.APPLICATION_JSON_VALUE)
public KtCommonResponse approveRcv(@RequestBody final KtApproveRcvRequest reqDTO) {
KtCommonResponse dto = service.approveRcv(reqDTO);
return dto;
}
@Operation(summary = "유통증명서발급처리 요청", description = "유통증명서발급처리 요청(BC-AG-SM-001)")
@Operation(hidden = true, summary = "유통증명서발급처리 요청", description = "유통증명서발급처리 요청(BC-AG-SM-001)")
@PostMapping(value = "/cerfAcmd", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> cerfAcmd(@RequestBody final KtAcmdCerfRequest reqDTO) {
KtAcmdCerfResponse dto = service.cerfAcmd(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "가상정산화면 연계토큰 인증 요청", description = "가상정산화면 연계토큰 인증 요청(BC-AG-SM-002)")
@Operation(hidden = true, summary = "가상정산화면 연계토큰 인증 요청", description = "가상정산화면 연계토큰 인증 요청(BC-AG-SM-002)")
@PostMapping(value = "/excaAcmd", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> excaAcmd(@RequestBody final KtTokenExcaRequest reqDTO) {
KtCommonResponse dto = service.excaAcmd(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "정산연계자료조회", description = "정산연계자료조회(BC-AG-EC-001)")
@Operation(hidden = true, summary = "정산연계자료조회", description = "정산연계자료조회(BC-AG-EC-001)")
@PostMapping(value = "/exca", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> exca(@RequestBody final KtExcaRequest reqDTO) {
KtExcaResponse dto = service.exca(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "전자문서 유통정보 수치 조회", description = "전자문서 유통정보 수치 조회(BC-AG-HS-001)")
@Operation(hidden = true, summary = "전자문서 유통정보 수치 조회", description = "전자문서 유통정보 수치 조회(BC-AG-HS-001)")
@PostMapping(value = "/infoAcmd", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> infoAcmd(@RequestBody final KtAcmdInfoRequest reqDTO) {
KtAcmdInfoResponse dto = service.infoAcmd(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "전자문서 유통정보 수치확인서 발급 처리", description = "전자문서 유통정보 수치확인서 발급 처리(BC-AG-HS-002)")
@Operation(hidden = true, summary = "전자문서 유통정보 수치확인서 발급 처리", description = "전자문서 유통정보 수치확인서 발급 처리(BC-AG-HS-002)")
@PostMapping(value = "/cfmAcmd", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> cfmAcmd(@RequestBody final KtAcmdInfoCfmRequest reqDTO) {
KtAcmdInfoCfmResponse dto = service.cfmAcmd(reqDTO);
return ApiResponseDTO.success(dto);
}
//------------------------------------------------------------------------------
}

@ -5,29 +5,22 @@ import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.validation.Validation;
import javax.validation.Validator;
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.ens.model.nice.NiceCiDTO;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.config.properties.PropertiesUtils;
import kr.xit.core.spring.util.ApiSpringUtils;
import kr.xit.core.spring.util.CoreSpringUtils;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.cmm.CmmEnsUtils;
import kr.xit.ens.nice.service.INiceCiService;
import kr.xit.ens.nice.service.NiceCiDummyTestService;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.http.HttpHeaders;
import org.springframework.util.Base64Utils;
@ -49,16 +42,9 @@ import org.springframework.util.Base64Utils;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CmmNiceCiUtils {
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private static final EgovMessageSource messageSource = CoreSpringUtils.getMessageSource();
private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService();
private static final INiceCiService niceCiService = ApiSpringUtils.getNiceCiService();
private static final NiceCiDummyTestService dummyTestService = ApiSpringUtils.getDummyNiceCiService();
private static final boolean IS_DUMMY = Boolean.valueOf(PropertiesUtils.getProperty("contract.nice.dummy"));
//private static final String FFNLG_CODE = PropertiesUtils.getProperty("contract.nice.ffnlg-code");
//private static final String CLIENT_ID = PropertiesUtils.getProperty("contract.nice.client-id");
/**
* Nice
@ -88,18 +74,15 @@ public class CmmNiceCiUtils {
if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getValidDtim()) < 0) return niceDTO;
// 1. 토큰 폐기
TokenRevokeResponse revokeResDTO = null;
if(IS_DUMMY) revokeResDTO = dummyTestService.revokeToken();
else revokeResDTO = niceCiService.revokeToken(reqDTO);
TokenRevokeResponse revokeResDTO = niceCiService.revokeToken(reqDTO);
if(!(revokeResDTO.getDataHeader().getGwRsltCd().equals("1200") && revokeResDTO.getDataBody().isResult())){
throw BizRuntimeException.create(JsonUtils.toJson(revokeResDTO.getDataHeader()));
}
// 2. 공개키 발급 요청
PublickeyResponse pubResDTO = null;
if(IS_DUMMY) pubResDTO = dummyTestService.requestPublickey();
else pubResDTO = niceCiService.requestPublickey(CmmEnsUtils.generateLengthUuid(24), niceDTO);
niceCiService.requestPublickey(CmmEnsUtils.generateLengthUuid(24), niceDTO);
return cacheService.getNiceCiInfoCache(reqDTO);
}
@ -118,8 +101,7 @@ public class CmmNiceCiUtils {
if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getCurSymkeyValidDtim()) < 0) return niceDTO;
// 1. 토큰 폐기
if(IS_DUMMY) dummyTestService.requestRegSymmetrickey(reqDTO);
else niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), null, niceDTO);
niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), null, niceDTO);
return cacheService.getNiceCiInfoCache(reqDTO);
}
@ -149,12 +131,10 @@ public class CmmNiceCiUtils {
String.format("%s %s",
type,
Base64Utils.encodeToString(
Base64Utils.encode(
String.format("%s:%s:%s",
accessToken,
(new Date().getTime() / 1000), clientId).getBytes(StandardCharsets.UTF_8))
)
)
);
return map;
}

@ -98,14 +98,12 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
"%s %s",
AUTH_TYPE_BASIC,
Base64Utils.encodeToString(
Base64Utils.encode(
String.format(
"%s:%s",
niceDTO.getClientId(),
niceDTO.getClientSecret()).getBytes(StandardCharsets.UTF_8)
)
)
)
);
return webClient.exchangeFormData(HOST + API_GENERATE_TOKEN, HttpMethod.POST, tokenRequest, NiceTokenResponse.class, map);
@ -199,8 +197,7 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
public SymmetrickeyResponse requestRegSymmetrickey(final String tranId, final SymkeyRegInfo symkeyRegInfo, final NiceCiInfo niceDTO) {
//FIXME::NICE 연계이후 comment 제거
//final String encSymkeyRegInfo = encodeString(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo));
final String encSymkeyRegInfo = "encodeStringniceDTOgetPublicKeyJsonUtilstoJsonsymkeyRegInfo";
final String encSymkeyRegInfo = CmmEnsUtils.encodeHmacSha256(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo));
final SymmetrickeyRequest reqDTO = SymmetrickeyRequest.builder()
.dataHeader(RequestDataHeader.builder()

@ -9,7 +9,6 @@ import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -40,7 +39,31 @@ public class KtCommonDTO {
@AllArgsConstructor
@SuperBuilder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class KtMnsRequest extends CmmEnsRequestDTO {
public static class KtMnsRequest {
/**
*
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "시군구코드", example = "88328")
@Size(min = 1, max = 10, message = "시군구 코드는 필수 입니다")
@JsonProperty("signguCode")
private String signguCode;
/**
*
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "과태료코드", example = "11")
@Size(min = 1, max = 2, message = "과태료 코드는 필수 입니다")
@JsonProperty("ffnlgCode")
private String ffnlgCode = "11";
/**
* active profile
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "profile", example = "dev")
@JsonProperty("profile")
private String profile;
/**
* Id
*/

@ -835,7 +835,7 @@ public class KtMmsSendDTO {
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "발송 요청 메시지 구분", example = "1")
@NotEmpty(message = "발송 요청 메시지 구분은 필수 입니다(0|1)")
private String reqMsgTypeDvcd;
private final String reqMsgTypeDvcd = "1";
@Schema(requiredMode = RequiredMode.REQUIRED)
@Valid

@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.net.URLEncoder;
import javax.validation.constraints.Size;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.core.model.IApiResponse;
@ -69,7 +68,7 @@ public class KtTokenDTO {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한부여방식", example = "clinet_credentials")
@NotEmpty(message = "권한부여방식은 필수 입니다")
@Size(max = 100)
private String grantType = URLEncoder.encode("client_credentials");
private String grantType = "client_credentials";
/**
*
@ -96,7 +95,7 @@ public class KtTokenDTO {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한범위", example = "ag.api")
@NotEmpty(message = "권한범위는 필수 입니다")
@Length(max = 100)
private String scope = URLEncoder.encode("ag.api");
private String scope = "ag.api";
}
@Schema(name = "KtTokenResponse", description = "KT MMS 토큰발행 요청 결과 DTO")
@ -214,7 +213,7 @@ public class KtTokenDTO {
* </pre>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "토큰", example = " ")
@Size(min = 1, max = 150, message = "토큰은 필수 입니다(max:150)")
@NotEmpty(message = "토큰은 필수 입니다")
private String accessToken;
}
//----------------------------------------------------------------------------------------
@ -240,8 +239,8 @@ public class KtTokenDTO {
* BizCenter
* </pre>>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "서비스코드", example = " ")
@NotEmpty(message = "서비스코드는 필수 입니다(max:20)")
@Schema(requiredMode = RequiredMode.REQUIRED, title = "열람타임스탬프", example = " ")
@NotEmpty(message = "열람타임스탬프는 필수입니다(max:20)")
private String mmsRdgTmst;
}
//-------------------------------------------------------------------
@ -269,7 +268,7 @@ public class KtTokenDTO {
* </pre>>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "엑세스토큰", example = " ")
@NotEmpty(message = "엑세스토큰은 필수 입니다(max:100)")
@NotEmpty(message = "엑세스토큰은 필수 입니다")
private String accessToken;
}
//-------------------------------------------------------------------

Loading…
Cancel
Save