feat: KT API 발송수신결과 add

dev
gitea-관리자 1 year ago
parent 6ad52cf26b
commit c7f524213b

@ -9,9 +9,12 @@ 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.KtCommonDTO.KtMnsRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData; import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendRequest; 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.KtTokenResponse; import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenResponse;
import kr.xit.biz.kt.mapper.IBizKtMmsMapper; import kr.xit.biz.kt.mapper.IBizKtMmsMapper;
import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.ens.kt.service.IKtMmsService; import kr.xit.ens.kt.service.IKtMmsService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
@ -105,7 +108,8 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
KtCommonResponse ktTokenResponse = null; KtCommonResponse ktTokenResponse = null;
for(List<KtMainSendReqData> reqs : parts) { for(List<KtMainSendReqData> reqs : parts) {
KtMainSendRequest ktReqDTO = KtMainSendRequest.builder() ktTokenResponse = ktMmsService.mainSend(
KtMainSendRequest.builder()
.signguCode(reqDTO.getSignguCode()) .signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode()) .ffnlgCode(reqDTO.getFfnlgCode())
.profile(profile) .profile(profile)
@ -122,14 +126,48 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
.fileFmat("db") .fileFmat("db")
.testSndnYn("N") .testSndnYn("N")
.reqs(reqs) .reqs(reqs)
.build()
);
}
return ktTokenResponse;
}
@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("yyyyMMddHHmmss"))
//.msgType("2")
.build(); .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())
.profile(profile)
.reqs(reqs)
.build()
);
ktTokenResponse = ktMmsService.mainSend(ktReqDTO);
} }
return ktTokenResponse; return ktTokenResponse;
} }
// /** // /**
// * 사전 문자 수신 등록 요청(BC-AG-SN-001) // * 사전 문자 수신 등록 요청(BC-AG-SN-001)
// * @param reqDTO // * @param reqDTO

@ -25,6 +25,7 @@ public interface IBizKtMmsService {
KtTokenResponse requestToken(final KtMnsRequest paramDTO); KtTokenResponse requestToken(final KtMnsRequest paramDTO);
KtCommonResponse mainSend(final KtMnsRequest reqDTO); KtCommonResponse mainSend(final KtMnsRequest reqDTO);
KtCommonResponse messageResult(final KtMnsRequest reqDTO);
// KtCommonResponse beforeSend(final KtBefSendRequest reqDTO); // KtCommonResponse beforeSend(final KtBefSendRequest reqDTO);
// KtCommonResponse mainSend(final KtMainSendRequest reqDTO); // KtCommonResponse mainSend(final KtMainSendRequest reqDTO);

@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Map; import java.util.Map;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse; 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.KtCommonDTO.KtMnsRequest;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMsgRsltRequest;
import kr.xit.biz.kt.service.IBizKtMmsService; import kr.xit.biz.kt.service.IBizKtMmsService;
import kr.xit.core.model.ApiResponseDTO; import kr.xit.core.model.ApiResponseDTO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -92,12 +93,34 @@ public class BizKtMmsController {
return ApiResponseDTO.success(dto); return ApiResponseDTO.success(dto);
} }
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "교통시설운영처",
value = PARAM1),
@ExampleObject(
name = "승화원",
value = PARAM2)
})
})
@Operation(summary = "사전/본 문자 발송/수신 결과 전송 요청", description = "사전/본 문자 발송/수신 결과 전송 요청(BC-AG-SN-010)")
@PostMapping(value = "/messageResult", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> messageResult(@RequestBody final KtMnsRequest reqDTO) {
KtCommonResponse dto = service.messageResult(reqDTO);
return ApiResponseDTO.success(dto);
}
@Operation(summary = "본문자 수신", description = "본문자 수신") @Operation(summary = "본문자 수신", description = "본문자 수신")
@PostMapping(value = "/receiveMain", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/receiveMain", produces = MediaType.APPLICATION_JSON_VALUE)
public void requestToken(@RequestBody final Map<String,Object> paramMap) { public void requestToken(@RequestBody final Map<String,Object> paramMap) {
log.debug("{}", paramMap); log.debug("{}", paramMap);
} }
// //
// /* // /*
// @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { // @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {

@ -862,8 +862,7 @@ public class KtMmsSendDTO {
* : Unique key * : Unique key
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "관리키", example = "S20211229102000001") @Schema(requiredMode = RequiredMode.REQUIRED, title = "관리키", example = "S20211229102000001")
@NotEmpty(message = "관리키는 필수 입니다(max:50)") @Size(min = 1, max = 50, message = "관리키는 필수 입니다(max:50)")
@Size(max = 50)
private String srcKey; private String srcKey;
/** /**
@ -901,7 +900,7 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "모바일사업자구분", example = "01") @Schema(requiredMode = RequiredMode.REQUIRED, title = "모바일사업자구분", example = "01")
@Size(min = 2, max = 2, message = "모바일 사업자 구분은 필수 입니다(01|02|03)") @Size(min = 2, max = 2, message = "모바일 사업자 구분은 필수 입니다(01|02|03)")
private String mblBzowrDvcd; private final String mblBzowrDvcd = "01";
/** /**
* <pre> * <pre>
@ -950,7 +949,7 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "발송 메시지 타입", example = "2") @Schema(requiredMode = RequiredMode.REQUIRED, title = "발송 메시지 타입", example = "2")
@Size(min = 1, max = 1, message = "발송 메시지 타입은 필수 입니다") @Size(min = 1, max = 1, message = "발송 메시지 타입은 필수 입니다")
private String msgType; private final String msgType = "2";
//------------------------------------------------------------------- //-------------------------------------------------------------------
/** /**
@ -961,7 +960,7 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.AUTO, title = "실제발송번호(일부)", example = " ") @Schema(requiredMode = RequiredMode.AUTO, title = "실제발송번호(일부)", example = " ")
@Size(max = 20, message = "실제발송번호(일부)는 20자를 넘을 수 없습니다.") @Size(max = 20, message = "실제발송번호(일부)는 20자를 넘을 수 없습니다.")
private String rl_mms_sndg_telno; private String rlMmsSndgTelno;
/** /**
* <pre> * <pre>

Loading…
Cancel
Save