feat: KT API 본문자 수신 결과 반영

dev
gitea-관리자 1 year ago
parent 5f755aa3e9
commit aa5eb73c7b

@ -3,9 +3,9 @@ package kr.xit.biz.kt.service;
import egovframework.com.cmm.EgovMessageSource;
import java.util.ArrayList;
import java.util.List;
import javax.transaction.Transactional;
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.KtServiceCode;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
@ -19,10 +19,11 @@ import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
import kr.xit.biz.kt.mapper.IBizKtMmsMapper;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.ens.cmm.CmmEnsUtils;
import kr.xit.ens.kt.cmm.CmmKtMmsUtils;
import kr.xit.ens.kt.service.IKtMmsService;
import kr.xit.ens.kt.web.KtMmsInboundController;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
@ -61,12 +62,14 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
private final EgovMessageSource messageSource;
/**
* <pre>
* kt Access token
* 1. kt Access token
* 2. DB
* 3.
* @param paramDTO
* @return
* @param paramDTO KtMnsRequest
* @return KtTokenResponse
* </pre>
*/
@Override
public KtTokenResponse requestToken(final KtMnsRequest paramDTO) {
@ -146,35 +149,35 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
return ktTokenResponse;
}
/**
* <pre>
* / /
* - KT
* - http://{각대행사(IP:Port)}/api/ag/message/result
* {@link KtMmsInboundController#messageResult messageResult}
*
*
* -> 1 ,
* ->
*
* @param reqDTO KtMsgRsltRequest
* @return KtCommonResponse
* </pre>
*/
@Override
@TraceLogging
@Transactional
public KtCommonResponse messageResult(KtMsgRsltRequest reqDTO) {
switch(KtServiceCode.compare(reqDTO.getServiceCd())){
case SISUL -> reqDTO.setSignguCode(SignguCode.TRAFFIC.getCode());
case CHUMO -> reqDTO.setSignguCode(SignguCode.FUNERAL.getCode());
}
reqDTO.setFfnlgCode(ApiConstants.FFNLN_CODE);
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
List<ErrorMsg> errors = CmmEnsUtils.getValidateErrors(reqDTO);
if(errors != null){
return KtCommonResponse.builder()
.resultCd("01")
.resultDt(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_EMPTY_DLT))
.errors(errors)
.build();
}
if(!errors.isEmpty()) return throwError(errors);
// FIXME::처리확인 필요
for(KtMsgRsltReqData dto : reqDTO.getReqs()){
dto.setMmsSndgRsltDvcdMsg(messageSource.getMessage("info.api.kt.msg.rslt."+dto.getMmsSndgRsltDvcd()));
mapper.updateKtBcDtl(dto);
if(mapper.updateKtBcDtl(dto) != 1)
errors.add(new ErrorMsg(String.format("존재 하지 않는 발송 대상(src_key[%s], mms_sndg_rslt_sqno[%s]) 입니다", dto.getSrcKey(), dto.getMmsSndgRsltSqno())));
}
if(!errors.isEmpty()) return throwError(errors);
return KtCommonResponse.builder()
.resultCd("00")
@ -182,39 +185,12 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
.build();
}
@Override
public KtCommonResponse messageResult(final KtMnsRequest reqDTO) {
List<KtMsgRsltReqData> rsltReqs = new ArrayList<>();
KtMsgRsltReqData reqData = KtMsgRsltReqData.builder()
.srcKey("db")
.mmsSndgRsltSqno(1) // ++
.prcsDt("YYYYMMDD")
.mmsBsnsDvcd("12345")
//.mblBzowrDvcd("01")
.mmsSndgRsltDvcd("40")
.mmsRdgTmst(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_EMPTY_DLT))
//.msgType("2")
private static KtCommonResponse throwError(List<ErrorMsg> errors) {
return KtCommonResponse.builder()
.resultCd("01")
.resultDt(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_EMPTY_DLT))
.errors(errors)
.build();
rsltReqs.add(reqData);
List<List<KtMsgRsltReqData>> parts = ListUtils.partition(rsltReqs, MAX_KT_SEND_CNT);
KtCommonResponse ktTokenResponse = null;
for(List<KtMsgRsltReqData> reqs : parts) {
ktTokenResponse = ktMmsService.messageResult(
KtMsgRsltRequest.builder()
.signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode())
.reqs(reqs)
.build()
);
}
return ktTokenResponse;
}
// /**

@ -28,8 +28,6 @@ public interface IBizKtMmsService {
KtCommonResponse mainSend(final KtMnsRequest reqDTO);
KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO);
KtCommonResponse messageResult(final KtMnsRequest reqDTO);
// KtCommonResponse beforeSend(final KtBefSendRequest reqDTO);
// KtCommonResponse mainSend(final KtMainSendRequest reqDTO);
// KtCommonResponse blacklist(final KtBlacklistRequest reqDTO);

@ -6,7 +6,6 @@ import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.tags.Tag;
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.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.kt.service.IBizKtMmsService;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
@ -93,43 +92,6 @@ public class BizKtMmsController {
return ApiResponseDTO.success(dto);
}
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
value = """
{
"service_cd" : "SMGT",
"req_msg_type_dvcd" : "1",
"reqs" : [
{
"src_key" : "S20211227100004",
"mms_sndg_rslt_sqno" : 1,
"prcs_dt" : "20211229",
"mms_bsns_dvcd" : "01002",
"mbl_bzowr_dvcd" : "01",
"rl_mms_sndg_telno" : "1234",
"mms_sndg_rslt_dvcd" : "40",
"mms_sndg_tmst" : "20211229102005",
"mms_rcv_tmst" : "20211229102020",
"mms_rdg_tmst" : "",
"prev_approve_yn" : "N",
"msg_type" : "2"
}
]
}
"""
),
})
})
@Operation(summary = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> 업무(Biz)단 API 사용", description = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> bulk처리를 위해 업무단의 API를 사용하여야 함")
@PostMapping(value = "/messageResult", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse messageResult(@RequestBody final KtMsgRsltRequest reqDTO) {
KtCommonResponse dto = service.messageResult(reqDTO);
return ApiResponseDTO.success(dto);
}
//
// /*
// @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {

@ -78,10 +78,6 @@ public class MobilePageController {
@PostMapping(
value = {"/kt/dpMblPage", "/kt/meMblPage"},
produces = MediaType.APPLICATION_JSON_VALUE)
// @RequestMapping(
// method = {RequestMethod.GET, RequestMethod.POST},
// value = {"/kt/dpMblPage", "/kt/meMblPage"},
// produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findKtMblPage(@RequestParam final String token, final HttpServletRequest request) {
final String uri = request.getRequestURI();
final KtTokenDTO.KtTokenConfirmRequest cfmReqDTO = KtTokenDTO.KtTokenConfirmRequest.builder()
@ -95,30 +91,4 @@ public class MobilePageController {
}
return ApiResponseDTO.success(service.findKtMblPage(cfmReqDTO));
}
// @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.findKtMblPage(
// 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.findKtMblPage(
// KtTokenConfirmRequest.builder()
// .signguCode(SignguCode.FUNERAL.getCode())
// .ffnlgCode(ApiConstants.FFNLN_CODE)
// .accessToken(token)
// .build()
// );
// return ApiResponseDTO.success(mblData);
// }
}

@ -63,8 +63,8 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
* @return
* </pre>
*/
@Transactional
@Override
@Transactional
public NiceTokenResponse generateToken(final NiceCiRequest reqDTO){
final NiceTokenResponse tokenResponse = niceCiService.generateToken(reqDTO);
final ResponseDataHeader dataHeader = tokenResponse.getDataHeader();
@ -103,8 +103,8 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
* @return
* </pre>
*/
@Transactional
@Override
@Transactional
public TokenRevokeResponse revokeToken(final NiceCiRequest reqDTO){
final TokenRevokeResponse resDTO = niceCiService.revokeToken(reqDTO);
final ResponseDataHeader dataHeader = resDTO.getDataHeader();
@ -146,8 +146,8 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
* @return PublickeyResponse
* </pre>
*/
@Transactional
@Override
@Transactional
public PublickeyResDataBody requestPublickey(final NiceCiRequest reqDTO) {
final NiceCiInfo niceDTO = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
if(ObjectUtils.isEmpty(niceDTO.getAccessToken())) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.token.info"));
@ -181,8 +181,8 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
* @return
* </pre>
*/
@Transactional
@Override
@Transactional
public SymkeyStatInfo requestRegSymmetrickey(final NiceCiRequest reqDTO) {
final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo();
final SymkeyStatInfo symkeyStatInfo = niceCiService.requestRegSymmetrickey(reqDTO, symkeyRegInfo);

@ -39,7 +39,8 @@ public class SpringDocsApiConfig {
return GroupedOpenApi.builder()
.group("2. 문서중계자 API")
.pathsToMatch(
"/api/ens/**"
"/api/ens/**",
"/api/ag/**"
)
.build();
}

@ -9,13 +9,13 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
@ -56,16 +56,12 @@ public class CmmEnsUtils {
final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
final Set<ConstraintViolation<T>> list = validator.validate(t);
if (list.size() > 0) {
List<String> errors = list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList());
if (!list.isEmpty()) {
throw BizRuntimeException.create(
list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
//.map(row -> String.format("%s=%s", row.getPropertyPath(), row.get()) ? row.getMessage(): row.getMessageTemplate()))
.collect(Collectors.toList()).toString());
.toList().toString());
}
}
@ -74,12 +70,12 @@ public class CmmEnsUtils {
final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
final Set<ConstraintViolation<T>> list = validator.validate(t);
if (list.size() > 0) {
if (!list.isEmpty()) {
return list.stream()
.map(row -> new ErrorMsg(String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())))
.collect(Collectors.toList());
.toList();
}
return null;
return new ArrayList<>();
}
public static String generateLengthUuid(int length) {
@ -117,15 +113,8 @@ public class CmmEnsUtils {
byte[] bytePlain = cipher.doFinal(symkeyRegInfo.getBytes());
return Base64Utils.encodeToString(bytePlain);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e){
throw BizRuntimeException.create(e.getMessage());
} catch (NoSuchPaddingException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (IllegalBlockSizeException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (BadPaddingException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (InvalidKeyException e) {
} catch (NoSuchAlgorithmException | InvalidKeySpecException | NoSuchPaddingException |
IllegalBlockSizeException | BadPaddingException | InvalidKeyException e){
throw BizRuntimeException.create(e.getMessage());
}
}
@ -139,7 +128,7 @@ public class CmmEnsUtils {
* @throws NoSuchAlgorithmException
*/
public static String hexSha256(final String text) {
final StringBuffer sbuf = new StringBuffer();
final StringBuilder sbuf = new StringBuilder();
try {
final MessageDigest mDigest = MessageDigest.getInstance("SHA-256");
@ -147,9 +136,9 @@ public class CmmEnsUtils {
final byte[] msgStr = mDigest.digest();
for(int i = 0; i < msgStr.length; i++) {
final byte tmpStrByte = msgStr[i];
final String tmpEncTxt = Integer.toString((tmpStrByte & 0xff) + 0x100, 16).substring(1);
for(final byte tmpStrByte : msgStr) {
final String tmpEncTxt = Integer.toString((tmpStrByte & 0xff) + 0x100, 16)
.substring(1);
sbuf.append(tmpEncTxt);
}
@ -179,11 +168,9 @@ public class CmmEnsUtils {
final byte[] encData = cipher.doFinal(planText.trim().getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(encData);
}catch (NoSuchPaddingException | NoSuchAlgorithmException e){
throw BizRuntimeException.create(e.getMessage());
} catch (InvalidAlgorithmParameterException | InvalidKeyException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (IllegalBlockSizeException | BadPaddingException e) {
}catch (NoSuchPaddingException | NoSuchAlgorithmException |
InvalidAlgorithmParameterException | InvalidKeyException |
IllegalBlockSizeException | BadPaddingException e){
throw BizRuntimeException.create(e.getMessage());
}
}
@ -221,11 +208,9 @@ public class CmmEnsUtils {
final byte[] decrypted = cipher.doFinal(respDataEnc);
return new String(decrypted);
}catch (NoSuchPaddingException|NoSuchAlgorithmException e){
throw BizRuntimeException.create(e.getMessage());
} catch (InvalidAlgorithmParameterException|InvalidKeyException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (IllegalBlockSizeException|BadPaddingException e) {
}catch (NoSuchPaddingException | NoSuchAlgorithmException |
InvalidAlgorithmParameterException | InvalidKeyException |
IllegalBlockSizeException | BadPaddingException e){
throw BizRuntimeException.create(e.getMessage());
}
}

@ -21,7 +21,6 @@ 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.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;
@ -52,7 +51,6 @@ public interface IKtMmsService {
KtCommonResponse mainSend(final KtMainSendRequest reqDTO);
KtTokenConfirmResponse cfmToken(final KtTokenConfirmRequest reqDTO);
KtCommonResponse readToken(final KtTokenReadRequest reqDTO);
KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO);
//------------------------------------------------------------------------------

@ -1,11 +1,7 @@
package kr.xit.ens.kt.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.KtServiceCode;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfResponse;
@ -27,8 +23,6 @@ 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.KtBefSendRequest;
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.KtTokenExcaRequest;
@ -92,18 +86,6 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
*/
@Value("${contract.kt.api.read-token}")
private String API_READ_TOKEN;
/**
* / / : BC-AG-SN-010
*/
@Value("${contract.kt.api.result-message}")
private String API_RESULT_MESSAGE;
/**
* callback URL
*/
// @Value("${contract.kt.api.dp-callback-url}")
// private String DP_CALLBACK_URL;
// @Value("${contract.kt.api.me-callback-url}")
// private String ME_CALLBACK_URL;
//-----------------------------------------------------------
@ -250,7 +232,7 @@ 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.setMmsRdgTmst(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_EMPTY_DLT));
reqDTO.setMmsRdgTmst(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"));
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
@ -264,36 +246,6 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
ktMnsInfo
);
}
@Override
@TraceLogging
public KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO) {
switch(KtServiceCode.compare(reqDTO.getServiceCd())){
case SISUL -> reqDTO.setSignguCode(SignguCode.TRAFFIC.getCode());
case CHUMO -> reqDTO.setSignguCode(SignguCode.FUNERAL.getCode());
}
reqDTO.setFfnlgCode(ApiConstants.FFNLN_CODE);
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setSignguCode(null);
reqDTO.setFfnlgCode(null);
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
List<KtMsgRsltReqData> reqs = reqDTO.getReqs();
//TODO :: BIZ 처리 반영 할것
// return webClient.exchangeKt(
// HOST + API_RESULT_MESSAGE,
// HttpMethod.POST,
// JsonUtils.toJson(reqDTO),
// KtCommonResponse.class,
// ktMnsInfo
// );
return null;
}
//------------------------------------------------------------------------------

@ -21,11 +21,11 @@ import kr.xit.biz.ens.model.kt.KtMmsDTO.KtSendSttcRequest;
import kr.xit.biz.ens.model.kt.KtMmsDTO.KtWhitelistRequest;
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.kt.service.IBizKtMmsService;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
import kr.xit.ens.kt.service.IKtMmsService;
@ -58,11 +58,12 @@ import org.springframework.web.bind.annotation.RestController;
public class KtMmsController {
private final IKtMmsService service;
private final IBizKtMmsService bizService;
//------------------------------------------------------------------------------
// mens 사용 API
//------------------------------------------------------------------------------
@Operation(deprecated = true, summary = "기관용 토큰 발급 요청 -> 업무(Biz)단 API 사용", description = "KT 문서 중개자 정보 DB update가 필요하여 업무단의 API를 사용하여야 함")
@Operation(deprecated = true, summary = "기관용 토큰 발급 요청 -> 업무(Biz)단 API 에서 처리", description = "KT 문서 중개자 정보 DB update가 필요하여 업무단의 API를 사용하여야 함")
@PostMapping(value = "/requestToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestToken(@RequestBody final KtMnsRequest paramDTO) {
return ApiResponseDTO.success(service.requestToken(paramDTO));
@ -85,7 +86,7 @@ public class KtMmsController {
* @return KtTokenConfirmResponse
* </pre>
*/
@Operation(summary = "토큰인증확인 조회(BC-AG-SN-008)", description = "토큰인증확인조회요청(BC-AG-SN-008)")
@Operation(deprecated = true, summary = "토큰인증확인 조회(BC-AG-SN-008) -> KT 모바일 데이타 요청(모바일 페이지에서 호출)에서 처리", description = "토큰인증확인조회요청(BC-AG-SN-008) <br><a href='http://localhost:8081/swagger-ui/index.html?urls.primaryName=6.%20%EC%A0%84%EC%9E%90%EA%B3%A0%EC%A7%80%20%EC%97%85%EB%AC%B4%20API#/MobilePageController'>전자문서중개자모바일페이지</a>")
@PostMapping(value = "/cfmToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse cfmToken(@RequestBody final KtTokenConfirmRequest reqDTO) {
KtTokenConfirmResponse dto = service.cfmToken(reqDTO);
@ -102,19 +103,12 @@ public class KtMmsController {
* @return KtCommonResponse
* </pre>
*/
@Operation(summary = "토큰열람확인결과 전송(BC-AG-SN-009)", description = "토큰열람확인결과 전송(BC-AG-SN-009)")
@Operation(deprecated = true, summary = "토큰열람확인결과 전송(BC-AG-SN-009) -> KT 모바일 데이타 요청(모바일 페이지에서 호출)에서 처리", description = "토큰열람확인결과 전송(BC-AG-SN-009) <br><a href='http://localhost:8081/swagger-ui/index.html?urls.primaryName=6.%20%EC%A0%84%EC%9E%90%EA%B3%A0%EC%A7%80%20%EC%97%85%EB%AC%B4%20API#/MobilePageController'>전자문서중개자모바일페이지</a>")
@PostMapping(value = "/readToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse readToken(@RequestBody final KtTokenReadRequest reqDTO) {
KtCommonResponse dto = service.readToken(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> 업무(Biz)단 API 사용", description = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> bulk처리를 위해 업무단의 API를 사용하여야 함")
@PostMapping(value = "/messageResult", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse messageResult(@RequestBody final KtMsgRsltRequest reqDTO) {
KtCommonResponse dto = service.messageResult(reqDTO);
return ApiResponseDTO.success(dto);
}
//------------------------------------------------------------------------------

@ -0,0 +1,80 @@
package kr.xit.ens.kt.web;
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.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.kt.service.IBizKtMmsService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* <pre>
* description : KT BC API
*
* packageName : kr.xit.ens.kt.web
* fileName : KtMmsController
* author : limju
* date : 2023-09-22
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-09-22 limju
*
* </pre>
*/
@Tag(name = "KtMmsInboundController", description = "KT MMS Inbound API")
@RequiredArgsConstructor
@RestController
public class KtMmsInboundController {
private final IBizKtMmsService bizService;
/**
* / / (BC-AG-SN-010)
* KT
* @param reqDTO KtMsgRsltRequest
* @return KtCommonResponse
*/
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
value = """
{
"service_cd" : "SISUL",
"req_msg_type_dvcd" : "1",
"reqs" : [
{
"src_key" : "S20211227100004",
"mms_sndg_rslt_sqno" : 1,
"prcs_dt" : "20211229",
"mms_bsns_dvcd" : "01002",
"mbl_bzowr_dvcd" : "01",
"rl_mms_sndg_telno" : "1234",
"mms_sndg_rslt_dvcd" : "40",
"mms_sndg_tmst" : "20211229102005",
"mms_rcv_tmst" : "20211229102020",
"mms_rdg_tmst" : "",
"prev_approve_yn" : "N",
"msg_type" : "2"
}
]
}
"""
),
})
})
@Operation(summary = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> KT BC에서 호출", description = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010) -> bulk처리를 위해 업무단의 API를 사용(KT BC에서 호출)")
@PostMapping(value = "/api/ag/message/result", produces = MediaType.APPLICATION_JSON_VALUE)
public KtCommonResponse messageResult(@RequestBody final KtMsgRsltRequest reqDTO) {
return bizService.messageResult(reqDTO);
}
//------------------------------------------------------------------------------
}

@ -832,7 +832,7 @@ public class KtMmsSendDTO {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@EqualsAndHashCode(callSuper = false)
public static class KtMsgRsltRequest extends KtCommonDTO.KtMnsRequest {
public static class KtMsgRsltRequest {
/**
* <pre>
* : - 20

Loading…
Cancel
Save