refactor: 기존 kakao -> v1으로 패키지 변경 적용

main
Jonguk. Lim 3 months ago
parent 861e49e7b8
commit 4545e29e3a

@ -1,4 +1,15 @@
select ECL_ENCRYPT('8312181157213');
/**
INSERT INTO tb_elctrn_ntic_sndng
(`ELCTRN_NTIC_SNDNG_ID`, `SIGNGU_CODE`, `NHT_TMPLAT_ID`, `SNDNG_TY_CODE`, `SNDNG_CO`, `SNDNG_PROCESS_STTUS`, `SNDNG_DT`, `CLOS_DT`, `REGIST_DT`, `REGISTER`, `UPDT_DT`, `UPDUSR`, `error_cn`, `error_dtls`)
VALUES
('202400000001', '51110', 'JU001', '1', 1, '01', '20240805141253', '20240930235959', '2024-08-05 14:10:53', NULL, '2024-08-07 18:05:51', 'ENS_SYS', NULL, NULL);
INSERT INTO tb_elctrn_ntic_sndng_detail
(`ELCTRN_NTIC_SNDNG_DETAIL_ID`, `ELCTRN_NTIC_SNDNG_ID`, `SIGNGU_CODE`, `MAIN_CODE`, `IHIDNUM`, `CN_DETAIL`, `MOBILE_PAGE_CN`, `REGIST_DT`, `REGISTER`, `UPDT_DT`, `UPDUSR`, `external_document_uuid`)
VALUES
('51110202400335801001', '202400000001', '51110', '5111020240033580', 'RUNCNjEwM0JERENGMEMzNjRBOTAyMERERjg5MDFEODc=', NULL, '{"details":[{"title":"주정차 위반 과태료 사전통지서","item_type":"TEXT","elements":[""]},{"title":"단속사진","item_type":"IMAGE","print_type":"SLIDE","elements":[{"key":"사진0","value":"http://noparking.chuncheon.go.kr/ens/img/prnt?link=http://152.99.141.24:30001/JUCHA_PHOTO/DATA/IMAGE/51110/51110/2024/5111020240033580A.jpg","level":0},{"key":"사진1","value":"http://noparking.chuncheon.go.kr/ens/img/prnt?link=http://152.99.141.24:30001/JUCHA_PHOTO/DATA/IMAGE/51110/51110/2024/5111020240033580B.jpg","level":1},{"key":"사진2","value":"http://noparking.chuncheon.go.kr/ens/img/prnt?link=http://152.99.141.24:30001/JUCHA_PHOTO/DATA/IMAGE/51110/51110/2024/5111020240033580C.jpg","level":2},{"key":"사진3","value":"http://noparking.chuncheon.go.kr/ens/img/prnt?link=http://152.99.141.24:30001/JUCHA_PHOTO/DATA/IMAGE/51110/51110/2024/5111020240033580D.jpg","level":3}]},{"title":"위반내역","item_type":"KEY_VALUE","properties":{"hyperlink":["https://www.wetax.go.kr"],"style":{"highlight":{"562-245-79175307":{"use-clipboard":"true"}}}},"elements":[{"key":"차량번호","value":"56거4441","level":1},{"key":"성명","value":"김정우","level":1},{"key":"위반일시","value":"2024-08-04 10:37","level":1},{"key":"위반내용","value":"주정차금지 구역","level":1},{"key":"위반장소","value":"퇴계동 퇴계로 부근","level":1},{"key":"납부금액","value":"32,000원","level":1},{"key":"단속구분","value":"이동형CCTV 033-250-3194,3800","level":1},{"key":"가상계좌","value":"신한 : 56224579175307\\n농협 : 79027653322219\\n우리 : 73171602792160\\n하나 : 61809652351237","level":1},{"key":"자진납부 및 의견제출기한","value":"2024-09-04\\n위 납부 기한이 경과시에는 과태료 감경 혜택을 받으실 수 없습니다.","level":1},{"key":"위택스","value":"https://www.wetax.go.kr","level":1}]},{"title":"자동차 등록별 과태료 부과 및 감경기준","item_type":"TABLE","elements":{"head":["구분","승용\\\\n부과금액","승용\\\\n감경후금액","승합\\\\n부과금액","승합\\\\n감경후금액"],"rows":[["주정차금지구역\\\\n(어린이보호구역 내)","40,000원\\\\n(120,000원)","32,000원\\\\n(96,000원)","50,000원\\\\n(130,000원)","40,000원\\\\n(104,000원)"],["같은 장소 2시간 초과\\\\n(어린이보호구역 내)","50,000원\\\\n(130,000원)","40,000원\\\\n(104,000원)","60,000원\\\\n(140,000원)","48,000원\\\\n(112,000원)"]]}},{"title":"질서위반행위 규제법 시행령 규정 감경 대상","item_type":"TABLE","elements":{"head":["감경대상자","시행일 및 적용대상","감경율(%)","비고"],"rows":[["○ 국민기초생활 수급자\\\\n○ 한부모가족 보호대상자\\\\n○ 장애의 정도가 심한 장애인\\\\n○ 국가유공자(상이등급 3급 이상)\\\\n○ 미성년자","○ 시행일 : 2010년 1월 16일 부터\\\\n○ 적용 : 시행일 이후 단속된 차량","○ 과태료 부과금액의 50%","※ 자진 납부 시 추가감경 가능"]]}}]}', '2024-08-05 14:10:53', NULL, NULL, NULL, 'B-202408051411000827Wmtv000000001');
commit;
*/
select *
from tb_elctrn_ntic_sndng;

@ -1,9 +1,10 @@
package kr.xit.biz.mbl.mapper;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
/**
* <pre>
@ -22,7 +23,8 @@ import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
*/
@Mapper
public interface IMobilePageMapper {
MobilePageManage selectKkoMobilePage(final OneTimeToken dto);
// FIXME: kakao v1 or v2
MobilePageManage selectKkoMobilePage(final KkopayDocDTO.OneTimeToken dto);
<T> MobilePageManage selectKtMobilePage(final T t);
MobilePageManage selectXitMobilePage(final CntcDTO.XitPage dto);
}

@ -1,7 +1,7 @@
package kr.xit.biz.mbl.service;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmRequest;
import kr.xit.core.model.IApiResponse;
@ -21,8 +21,8 @@ import kr.xit.core.model.IApiResponse;
* </pre>
*/
public interface IMobilePageService {
IApiResponse findKkoMyDocReadyAndMblPage(OneTimeToken reqDTO);
// FIXME: kakao v1 or v2
IApiResponse findKkoMyDocReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO);
IApiResponse findKtMblPage(final KtTokenConfirmRequest reqDTO);

@ -1,7 +1,9 @@
package kr.xit.biz.mbl.service;
import org.springframework.stereotype.Service;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.mbl.mapper.IMobilePageMapper;
@ -13,11 +15,10 @@ import kr.xit.core.model.IApiResponse;
import kr.xit.core.service.AbstractService;
import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.support.utils.Checks;
import kr.xit.ens.kakao.service.IKkopayEltrcDocService;
import kr.xit.ens.kakao.v1.service.IKkopayEltrcDocService;
import kr.xit.ens.kt.service.IKtMmsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* <pre>

@ -1,22 +1,24 @@
package kr.xit.biz.mbl.web;
import javax.servlet.http.HttpServletRequest;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.servlet.http.HttpServletRequest;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.mbl.service.IMobilePageService;
import kr.xit.core.model.IApiResponse;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* <pre>

@ -1,4 +1,6 @@
package kr.xit.ens.kakao.cmm;
package kr.xit.ens.kakao.v1.cmm;
import org.apache.commons.lang3.ObjectUtils;
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
@ -9,13 +11,12 @@ import kr.xit.core.spring.util.CoreSpringUtils;
import kr.xit.core.spring.util.MessageUtil;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
/**
* <pre>
* description :
*
* packageName : kr.xit.ens.kakao.cmm
* packageName : kr.xit.ens.kakaov1..cmm
* fileName : CmmKakaoUtils
* author : limju
* date : 2023-09-19

@ -1,27 +1,25 @@
package kr.xit.ens.kakao.service;
package kr.xit.ens.kakao.v1.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.DocStatusResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.RequestSend;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenResponse;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.service.AbstractService;
@ -29,18 +27,14 @@ import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.Checks;
import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.kakao.cmm.CmmKakaoUtils;
import kr.xit.ens.kakao.v1.cmm.CmmKakaoUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
* <pre>
* description :
* packageName : kr.xit.ens.kakao.service
* packageName : kr.xit.ens.kakao.v1.service
* fileName : KkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -88,11 +82,11 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<SendResponse>> requestSend(final SendRequest reqDTO) {
public CompletableFuture<ApiResponseDTO<KkopayDocDTO.SendResponse>> requestSend(final KkopayDocDTO.SendRequest reqDTO) {
List<String> errors = new ArrayList<>();
errors = validate(reqDTO.getDocument(), errors);
final RequestSend reqSendDTO = reqDTO.getDocument();
final KkopayDocDTO.RequestSend reqSendDTO = reqDTO.getDocument();
if(reqSendDTO.getRead_expired_at() != null && reqSendDTO.getRead_expired_sec() != null){
Objects.requireNonNull(errors).add("처리마감시간(절대시간 또는 상대시간)은 하나만 지정해야 합니다.");
}
@ -101,7 +95,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
Objects.requireNonNull(errors).add("처리마감시간(절대시간 또는 상대시간)을 지정해야 합니다.");
}
final Receiver receiver = reqSendDTO.getReceiver();
final KkopayDocAttrDTO.Receiver receiver = reqSendDTO.getReceiver();
if(Checks.isEmpty(receiver.getCi())){
if(Checks.isEmpty(receiver.getName())) Objects.requireNonNull(errors).add("receiver.name=받는이 이름은 필수입니다.");
if(Checks.isEmpty(receiver.getPhone_number())) Objects.requireNonNull(errors).add("receiver.phone_number=받는이 전화번호는 필수입니다.");
@ -110,7 +104,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
if(Objects.requireNonNull(errors).size() > 0) throw BizRuntimeException.create(errors.toString());
return CompletableFuture.supplyAsync(() ->
webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), KkopayDocDTO.SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
.handle((r, e) -> {
if(e != null){
return webClient.sendError(e);
@ -129,7 +123,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<ValidTokenResponse>> validToken(final ValidTokenRequest reqDTO) {
public CompletableFuture<ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>> validToken(final KkopayDocDTO.ValidTokenRequest reqDTO) {
validate(reqDTO, null);
final String url = HOST
@ -137,7 +131,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
.replace("{tokens}", reqDTO.getToken());
return CompletableFuture.supplyAsync(() ->
webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, KkopayDocDTO.ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
.handle((r, e) -> {
if(e != null){
return webClient.sendError(e);
@ -160,7 +154,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<Void>> modifyStatus(final DocumentBinderUuid reqDTO){
public CompletableFuture<ApiResponseDTO<Void>> modifyStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO){
validate(reqDTO, null);
final String body = "{\"document\": {\"is_detail_read\": true} }";
@ -191,12 +185,12 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<DocStatusResponse>> findStatus(final DocumentBinderUuid reqDTO){
public CompletableFuture<ApiResponseDTO<KkopayDocDTO.DocStatusResponse>> findStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO){
validate(reqDTO, null);
final String url = HOST + API_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
return CompletableFuture.supplyAsync(() ->
webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, KkopayDocDTO.DocStatusResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
.handle((r, e) -> {
if(e != null){
return webClient.sendError(e);
@ -216,9 +210,9 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<BulkSendResponses>> requestSendBulk(final BulkSendRequests reqDTO) {
public CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkSendResponses>> requestSendBulk(final KkopayDocBulkDTO.BulkSendRequests reqDTO) {
return CompletableFuture.supplyAsync(() ->
webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), KkopayDocBulkDTO.BulkSendResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
.handle((r, e) -> {
if(e != null){
return webClient.sendError(e);
@ -242,7 +236,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
@Override
@TraceLogging
@Async("asyncExecutor")
public CompletableFuture<ApiResponseDTO<BulkStatusResponses>> findBulkStatus(final BulkStatusRequests reqDTO) {
public CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkStatusResponses>> findBulkStatus(final KkopayDocBulkDTO.BulkStatusRequests reqDTO) {
List<String> errors = new ArrayList<>();
final List<String> dtos = reqDTO.getDocument_binder_uuids();
@ -257,7 +251,7 @@ public class AsyncKkopayEltrcDocService extends AbstractService implements
}
return CompletableFuture.supplyAsync(() ->
webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), KkopayDocBulkDTO.BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())))
.handle((r, e) -> {
if(e != null){
return webClient.sendError(e);

@ -1,22 +1,16 @@
package kr.xit.ens.kakao.service;
package kr.xit.ens.kakao.v1.service;
import java.util.concurrent.CompletableFuture;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.DocStatusResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenResponse;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.core.model.ApiResponseDTO;
/**
* <pre>
* description :
* packageName : kr.xit.ens.kakao.service
* packageName : kr.xit.ens.kakao.v1.service
* fileName : IKkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -37,7 +31,7 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocDTO.SendRequest
* @return CompletableFuture<ApiResponseDTO<KkopayDocDTO.SendResponse>>
*/
CompletableFuture<ApiResponseDTO<SendResponse>> requestSend(final SendRequest reqDTO);
CompletableFuture<ApiResponseDTO<KkopayDocDTO.SendResponse>> requestSend(final KkopayDocDTO.SendRequest reqDTO);
/**
@ -47,7 +41,7 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocDTO.ValidTokenRequest
* @return CompletableFuture<ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>>
*/
CompletableFuture<ApiResponseDTO<ValidTokenResponse>> validToken(final ValidTokenRequest reqDTO);
CompletableFuture<ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>> validToken(final KkopayDocDTO.ValidTokenRequest reqDTO);
/**
* <pre>
@ -60,7 +54,7 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
* @return CompletableFuture<ApiResponseDTO<Void>>
*/
CompletableFuture<ApiResponseDTO<Void>> modifyStatus(final DocumentBinderUuid reqDTO);
CompletableFuture<ApiResponseDTO<Void>> modifyStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO);
/**
@ -75,7 +69,7 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
* @return CompletableFuture<ApiResponseDTO<KkopayDocDTO.DocStatusResponse>>
*/
CompletableFuture<ApiResponseDTO<DocStatusResponse>> findStatus(final DocumentBinderUuid reqDTO);
CompletableFuture<ApiResponseDTO<KkopayDocDTO.DocStatusResponse>> findStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO);
/**
* <pre>
@ -85,7 +79,7 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocBulkDTO.BulkSendRequests
* @return CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkSendResponses>>
*/
CompletableFuture<ApiResponseDTO<BulkSendResponses>> requestSendBulk(final BulkSendRequests reqDTO);
CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkSendResponses>> requestSendBulk(final KkopayDocBulkDTO.BulkSendRequests reqDTO);
/**
* <pre>
@ -99,6 +93,6 @@ public interface IAsyncKkopayEltrcDocService {
* @param reqDTO KkopayDocBulkDTO.BulkStatusRequests
* @return CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkStatusResponses>>
*/
CompletableFuture<ApiResponseDTO<BulkStatusResponses>> findBulkStatus(final BulkStatusRequests reqDTO);
CompletableFuture<ApiResponseDTO<KkopayDocBulkDTO.BulkStatusResponses>> findBulkStatus(final KkopayDocBulkDTO.BulkStatusRequests reqDTO);
}

@ -1,22 +1,14 @@
package kr.xit.ens.kakao.service;
package kr.xit.ens.kakao.v1.service;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.DocStatusResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenResponse;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.core.model.ApiResponseDTO;
/**
* <pre>
* description :
* packageName : kr.xit.ens.kakao.service
* packageName : kr.xit.ens.kakao.v1.service
* fileName : IKkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -37,7 +29,7 @@ public interface IKkopayEltrcDocService {
* @param reqDTO KkopayDocDTO.SendRequest
* @return KkopayDocDTO.SendResponse
*/
SendResponse requestSend(final SendRequest reqDTO);
KkopayDocDTO.SendResponse requestSend(final KkopayDocDTO.SendRequest reqDTO);
/**
* <pre>
@ -46,7 +38,7 @@ public interface IKkopayEltrcDocService {
* @param reqDTO KkopayDocDTO.ValidTokenRequest
* @return ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>
*/
ValidTokenResponse validToken(final ValidTokenRequest reqDTO);
KkopayDocDTO.ValidTokenResponse validToken(final KkopayDocDTO.ValidTokenRequest reqDTO);
/**
* <pre>
@ -58,7 +50,7 @@ public interface IKkopayEltrcDocService {
* </pre>
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
*/
void modifyStatus(final DocumentBinderUuid reqDTO);
void modifyStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO);
/**
@ -73,7 +65,7 @@ public interface IKkopayEltrcDocService {
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
* @return KkopayDocDTO.DocStatusResponse
*/
DocStatusResponse findStatus(final DocumentBinderUuid reqDTO);
KkopayDocDTO.DocStatusResponse findStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO);
/**
* <pre>
@ -83,7 +75,7 @@ public interface IKkopayEltrcDocService {
* @param reqDTO KkopayDocBulkDTO.BulkSendRequests
* @return KkopayDocBulkDTO.BulkSendResponses
*/
BulkSendResponses requestSendBulk(final BulkSendRequests reqDTO);
KkopayDocBulkDTO.BulkSendResponses requestSendBulk(final KkopayDocBulkDTO.BulkSendRequests reqDTO);
/**
* <pre>
@ -97,9 +89,9 @@ public interface IKkopayEltrcDocService {
* @param reqDTO KkopayDocBulkDTO.BulkStatusRequests
* @return KkopayDocBulkDTO.BulkStatusResponses
*/
BulkStatusResponses findBulkStatus(final BulkStatusRequests reqDTO);
KkopayDocBulkDTO.BulkStatusResponses findBulkStatus(final KkopayDocBulkDTO.BulkStatusRequests reqDTO);
ApiResponseDTO<ValidTokenResponse> findMyDocReadyAndMblPage(OneTimeToken reqDTO);
ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO);
}

@ -1,30 +1,26 @@
package kr.xit.ens.kakao.service;
package kr.xit.ens.kakao.v1.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
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.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.DocStatusResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.RequestSend;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenResponse;
import kr.xit.biz.ens.model.kakao.KkopayErrorDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayErrorDTO;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.service.AbstractService;
@ -35,15 +31,11 @@ import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.cmm.CmmEnsUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
/**
* <pre>
* description :
* packageName : kr.xit.ens.kakao.service
* packageName : kr.xit.ens.kakao.v1.service
* fileName : KkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -90,11 +82,11 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public SendResponse requestSend(final SendRequest reqDTO) {
public KkopayDocDTO.SendResponse requestSend(final KkopayDocDTO.SendRequest reqDTO) {
List<String> errors = new ArrayList<>();
errors = validate(reqDTO.getDocument(), errors);
final RequestSend reqSendDTO = reqDTO.getDocument();
final KkopayDocDTO.RequestSend reqSendDTO = reqDTO.getDocument();
if(reqSendDTO.getRead_expired_at() != null && reqSendDTO.getRead_expired_sec() != null){
Objects.requireNonNull(errors).add("처리마감시간(절대시간 또는 상대시간)은 하나만 지정해야 합니다.");
}
@ -102,14 +94,14 @@ public class KkopayEltrcDocService extends AbstractService implements
Objects.requireNonNull(errors).add("처리마감시간(절대시간 또는 상대시간)을 지정해야 합니다.");
}
final Receiver receiver = reqSendDTO.getReceiver();
final KkopayDocAttrDTO.Receiver receiver = reqSendDTO.getReceiver();
if(Checks.isEmpty(receiver.getCi())){
if(Checks.isEmpty(receiver.getName())) Objects.requireNonNull(errors).add("receiver.name=받는이 이름은 필수입니다.");
if(Checks.isEmpty(receiver.getPhone_number())) Objects.requireNonNull(errors).add("receiver.phone_number=받는이 전화번호는 필수입니다.");
if(Checks.isEmpty(receiver.getBirthday())) Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다.");
}
if(!Objects.requireNonNull(errors).isEmpty()) throw BizRuntimeException.create(errors.toString());
return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getRlaybsnmInfo(reqDTO));
return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), KkopayDocDTO.SendResponse.class, getRlaybsnmInfo(reqDTO));
}
/**
@ -121,13 +113,13 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public ValidTokenResponse validToken(final ValidTokenRequest reqDTO) {
public KkopayDocDTO.ValidTokenResponse validToken(final KkopayDocDTO.ValidTokenRequest reqDTO) {
validate(reqDTO, null);
final String url = HOST
+ API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
.replace("{tokens}", reqDTO.getToken());
return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, getRlaybsnmInfo(reqDTO));
return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, KkopayDocDTO.ValidTokenResponse.class, getRlaybsnmInfo(reqDTO));
}
/**
@ -142,7 +134,7 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public void modifyStatus(final DocumentBinderUuid reqDTO){
public void modifyStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO){
validate(reqDTO, null);
final String body = "{\"document\": {\"is_detail_read\": true} }";
@ -165,11 +157,11 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public DocStatusResponse findStatus(final DocumentBinderUuid reqDTO){
public KkopayDocDTO.DocStatusResponse findStatus(final KkopayDocAttrDTO.DocumentBinderUuid reqDTO){
validate(reqDTO, null);
final String url = HOST + API_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, getRlaybsnmInfo(reqDTO));
return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, KkopayDocDTO.DocStatusResponse.class, getRlaybsnmInfo(reqDTO));
}
/**
@ -182,12 +174,12 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public BulkSendResponses requestSendBulk(final BulkSendRequests reqDTO) {
public KkopayDocBulkDTO.BulkSendResponses requestSendBulk(final KkopayDocBulkDTO.BulkSendRequests reqDTO) {
List<String> errors = new ArrayList<>();
List<BulkSendReq> dtos = reqDTO.getDocuments();
List<KkopayDocBulkDTO.BulkSendReq> dtos = reqDTO.getDocuments();
for(int idx = 0; idx < dtos.size(); idx++) {
final Set<ConstraintViolation<BulkSendReq>> list = validator.validate(dtos.get(idx));
final Set<ConstraintViolation<KkopayDocBulkDTO.BulkSendReq>> list = validator.validate(dtos.get(idx));
if (!list.isEmpty()) {
int finalIdx = idx;
@ -206,7 +198,7 @@ public class KkopayEltrcDocService extends AbstractService implements
errors.add("처리마감시간(절대시간 또는 상대시간)을 지정해야 합니다.");
}
final Receiver receiver = dtos.get(idx).getReceiver();
final KkopayDocAttrDTO.Receiver receiver = dtos.get(idx).getReceiver();
if (Checks.isEmpty(receiver.getCi())) {
if (Checks.isEmpty(receiver.getName())) errors.add(String.format("받는이 이름은 필수입니다(receiver.name[%d] 번째 오류)", idx+1));
if (Checks.isEmpty(receiver.getPhone_number())) errors.add(String.format("받는이 전화번호는 필수입니다(receiver.phone_number[%d] 번째 오류)", idx+1));
@ -226,7 +218,7 @@ public class KkopayEltrcDocService extends AbstractService implements
throw BizRuntimeException.create(errors.toString());
}
return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, getRlaybsnmInfo(reqDTO));
return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), KkopayDocBulkDTO.BulkSendResponses.class, getRlaybsnmInfo(reqDTO));
}
/**
@ -243,7 +235,7 @@ public class KkopayEltrcDocService extends AbstractService implements
*/
@Override
@TraceLogging
public BulkStatusResponses findBulkStatus(final BulkStatusRequests reqDTO) {
public KkopayDocBulkDTO.BulkStatusResponses findBulkStatus(final KkopayDocBulkDTO.BulkStatusRequests reqDTO) {
List<String> errors = new ArrayList<>();
List<String> dtos = reqDTO.getDocument_binder_uuids();
@ -256,17 +248,17 @@ public class KkopayEltrcDocService extends AbstractService implements
if(!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString());
}
return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getRlaybsnmInfo(reqDTO));
return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), KkopayDocBulkDTO.BulkStatusResponses.class, getRlaybsnmInfo(reqDTO));
}
@Override
public ApiResponseDTO<ValidTokenResponse> findMyDocReadyAndMblPage(final OneTimeToken reqDTO) {
public ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(final KkopayDocDTO.OneTimeToken reqDTO) {
final String url = HOST + API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
.replace("{tokens}", reqDTO.getToken());
// 유효성 검증
final ValidTokenResponse validTokenRes = webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null,
ValidTokenResponse.class, getRlaybsnmInfo(reqDTO));
final KkopayDocDTO.ValidTokenResponse validTokenRes = webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null,
KkopayDocDTO.ValidTokenResponse.class, getRlaybsnmInfo(reqDTO));
if(!"USED".equals(validTokenRes.getToken_status())){
return ApiResponseDTO.error(validTokenRes.getError_code(), validTokenRes.getError_message());

@ -0,0 +1,178 @@
// package kr.xit.ens.kakao.v1.web;
//
// 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.RequestMapping;
// import org.springframework.web.bind.annotation.RestController;
//
// 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.kakao.v1.KkopayDocAttrDTO;
// import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
// import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
// import kr.xit.core.model.ApiResponseDTO;
// import kr.xit.core.model.IApiResponse;
// import kr.xit.ens.kakao.v1.service.IAsyncKkopayEltrcDocService;
// import lombok.RequiredArgsConstructor;
// import lombok.extern.slf4j.Slf4j;
//
// /**
// * <pre>
// * description : 카카오 페이 전자 문서 발송 비동기용 controller
// * packageName : kr.xit.ens.kakao.v1.web
// * fileName : AsyncKkopayEltrcDocController
// * author : julim
// * date : 2023-04-28
// * ======================================================================
// * 변경일 변경자 변경 내용
// * ----------------------------------------------------------------------
// * 2023-04-28 julim 최초 생성
// *
// * </pre>
// */
// @Tag(name = "AsyncKkopayEltrcDocController", description = "카카오페이 MyDoc API(비동기)")
// @Slf4j
// @RequiredArgsConstructor
// @RestController
// @RequestMapping(value = "/api/ens/kakao/v2")
// public class AsyncKkopayEltrcDocController {
//
// private final IAsyncKkopayEltrcDocService service;
//
// /**
// * <pre>
// * 모바일웹 연계 문서발송 요청
// * -.이용기관 서버에서 전자문서 서버로 문서발송 처리를 요청합니다.
// * </pre>
// * @param reqDTO KkopayDocDTO.SendRequest
// * @return ApiResponseDTO{@literal <KkopayDocDTO.SendResponse>}
// */
// @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
// @Content(mediaType = "application/json", examples = {
// @ExampleObject(value = """
// {
// "document": {
// "title": "문서 제목",
// "read_expired_sec": 3600,
// "hash": "6EFE827AC88914DE471C621AE",
// "common_categories": [
// "NOTICE"
// ],
// "receiver": {
// "phone_number": "01093414345",
// "name": "김지호",
// "birthday": "19831218",
// "is_required_verify_name": false
// },
// "property": {
// "link": "http://ip:8081/api/kakaopay/v1/ott",
// "cs_number": "02-123-4567",
// "cs_name": "콜센터",
// "payload": "payload 파라미터 입니다.",
// "message": "해당 안내문은 다음과 같습니다."
// }
// },
// "signguCode": "88328",
// "ffnlgCode": "11"
// }
// """)
// })
// })
// @Operation(hidden = true, summary = "문서발송 요청", description = "카카오페이 전자문서 서버로 문서발송 처리를 요청")
// @PostMapping(value = "/documents", produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse requestSend(
// @RequestBody final KkopayDocDTO.SendRequest reqDTO
// ) {
// return ApiResponseDTO.of(service.requestSend(reqDTO));
// }
//
//
// /**
// * <pre>
// * 토큰 유효성 검증(Redirect URL 접속 허용/불허)
// * </pre>
// * @param reqDTO KkopayDocDTO.ValidTokenRequest
// * @return ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>
// */
// @Operation(hidden = true, summary = "토큰 유효성 검증", description = "Redirect URL 접속 허용/불허")
// @PostMapping(value = "/validToken", produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse validToken(
// @RequestBody final KkopayDocDTO.ValidTokenRequest reqDTO
// ) {
// return ApiResponseDTO.of(service.validToken(reqDTO));
// }
//
// /**
// * <pre>
// * 문서 상태 변경 API
// * -.문서에 대해서 열람 상태로 변경. 사용자가 문서열람 시(OTT 검증 완료 후 페이지 로딩 완료 시점) 반드시 문서 열람 상태 변경 API를 호출해야 함.
// * -.미 호출 시 아래와 같은 문제 발생
// * 1)유통증명시스템을 사용하는 경우 해당 API를 호출한 시점으로 열람정보가 등록되어 미 호출 시 열람정보가 등록 되지 않음.
// * 2)문서상태조회 API(/v1/documents/{document_binder_uuid}/status) 호출 시 read_at최초 열람시간) 데이터가 내려가지 않음.
// * </pre>
// * @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
// * @return ApiResponseDTO<Void>
// */
// @Operation(hidden = true, summary = "문서 상태 변경", description = "문서 상태 변경")
// @PostMapping(value = "/modifyStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse modifyStatus(
// @RequestBody final KkopayDocAttrDTO.DocumentBinderUuid reqDTO
// ) {
// return ApiResponseDTO.of(service.modifyStatus(reqDTO));
// }
//
// /**
// * <pre>
// * 문서 상태 조회 API
// * -.이용기관 서버에서 카카오페이 전자문서 서버로 문서 상태에 대한 조회를 요청 합니다.
// * : 발송된 문서의 진행상태를 알고 싶은 경우, flow와 상관없이 요청 가능
// * : polling 방식으로 호출할 경우, 호출 간격은 5초를 권장.
// * -.doc_box_status 상태변경순서
// * : SENT(송신) > RECEIVED(수신) > READ(열람)/EXPIRED(미열람자료의 기한만료)
// * </pre>
// * @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
// * @return ApiResponseDTO<KkopayDocDTO.DocStatusResponse>
// */
// @Operation(hidden = true, summary = "문서 상태 조회", description = "문서 상태 조회")
// @PostMapping(value = "/findStatus", produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse findStatus(
// @RequestBody final KkopayDocAttrDTO.DocumentBinderUuid reqDTO
// ) {
// return ApiResponseDTO.of(service.findStatus(reqDTO));
// }
//
//
// @Operation(hidden = true, summary = "대량 문서발송 요청", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청")
// @PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse requestSendBulk(
// @RequestBody final KkopayDocBulkDTO.BulkSendRequests reqDTO
// ) {
// return ApiResponseDTO.of(service.requestSendBulk(reqDTO));
// }
//
// /**
// * <pre>
// * 모바일웹 연계 문서발송 요청
// * -.이용기관 서버에서 전자문서 서버로 문서발송 처리를 요청합니다.
// * </pre>
// * @param reqDTO KkopayDocBulkDTO.BulkStatusRequests
// * @return ApiResponseDTOApiResponseDTO<BulkStatusResponses.BulkStatusResponses>
// */
// @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
// @Content(mediaType = "application/json", examples = {
// @ExampleObject(value = "{\"document_binder_uuids\": [\n"
// + " \"BIN-883246dbff7b11edb3bb7affed8a016d\"\n"
// + " ]}")
// })
// })
// @Operation(hidden = true, summary = "대량 문서 상태 조회 요청", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청")
// @PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE)
// public IApiResponse findBulkStatus(
// @RequestBody final KkopayDocBulkDTO.BulkStatusRequests reqDTO
// ) {
// return ApiResponseDTO.of(service.findBulkStatus(reqDTO));
// }
// }

@ -1,29 +1,28 @@
package kr.xit.ens.kakao.web;
package kr.xit.ens.kakao.v1.web;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
import kr.xit.ens.kakao.service.IKkopayEltrcDocService;
import kr.xit.ens.kakao.v1.service.IKkopayEltrcDocService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <pre>
* description : controller
* packageName : kr.xit.ens.kakao.web
* packageName : kr.xit.ens.kakao.v1.web
* fileName : KkopayEltrcDocController
* author : julim
* date : 2023-04-28
@ -84,7 +83,7 @@ public class KkopayEltrcDocController {
})
@PostMapping(value = "/documents", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSend(
@RequestBody final SendRequest reqDTO
@RequestBody final KkopayDocDTO.SendRequest reqDTO
) {
return ApiResponseDTO.success(service.requestSend(reqDTO));
}
@ -99,7 +98,7 @@ public class KkopayEltrcDocController {
@Operation(summary = "토큰 유효성 검증", description = "Redirect URL 접속 허용/불허")
@PostMapping(value = "/validToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse validToken(
@RequestBody final ValidTokenRequest reqDTO
@RequestBody final KkopayDocDTO.ValidTokenRequest reqDTO
) {
return ApiResponseDTO.success(service.validToken(reqDTO));
}
@ -118,7 +117,7 @@ public class KkopayEltrcDocController {
@Operation(summary = "문서 상태 변경", description = "문서 상태 변경")
@PostMapping(value = "/modifyStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse modifyStatus(
@RequestBody final DocumentBinderUuid reqDTO
@RequestBody final KkopayDocAttrDTO.DocumentBinderUuid reqDTO
) {
service.modifyStatus(reqDTO);
return ApiResponseDTO.empty();
@ -139,7 +138,7 @@ public class KkopayEltrcDocController {
@Operation(summary = "문서 상태 조회", description = "문서 상태 조회")
@PostMapping(value = "/findStatus", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findStatus(
@RequestBody final DocumentBinderUuid reqDTO
@RequestBody final KkopayDocAttrDTO.DocumentBinderUuid reqDTO
) {
return ApiResponseDTO.success(service.findStatus(reqDTO));
}
@ -164,7 +163,7 @@ public class KkopayEltrcDocController {
@Operation(summary = "대량 문서발송 요청 -> batch sendBulks 에서 호출", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청 -> batch sendBulks 에서 호출")
@PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSendBulk(
@RequestBody final BulkSendRequests reqDTO
@RequestBody final KkopayDocBulkDTO.BulkSendRequests reqDTO
) {
return ApiResponseDTO.success(service.requestSendBulk(reqDTO));
}
@ -180,7 +179,7 @@ public class KkopayEltrcDocController {
@Operation(summary = "대량 문서 상태 조회 요청 -> batch statusBulks 에서 호출", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청 -> batch statusBulks 에서 호출")
@PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findBulkStatus(
@RequestBody final BulkStatusRequests reqDTO
@RequestBody final KkopayDocBulkDTO.BulkStatusRequests reqDTO
) {
return ApiResponseDTO.success(service.findBulkStatus(reqDTO));
}

@ -1,180 +0,0 @@
package kr.xit.ens.kakao.web;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.ValidTokenRequest;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
import kr.xit.ens.kakao.service.IAsyncKkopayEltrcDocService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* <pre>
* description : controller
* packageName : kr.xit.ens.kakao.web
* fileName : AsyncKkopayEltrcDocController
* author : julim
* date : 2023-04-28
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-04-28 julim
*
* </pre>
*/
@Tag(name = "AsyncKkopayEltrcDocController", description = "카카오페이 MyDoc API(비동기)")
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/ens/kakao/v2")
public class AsyncKkopayEltrcDocController {
private final IAsyncKkopayEltrcDocService service;
/**
* <pre>
*
* -. .
* </pre>
* @param reqDTO KkopayDocDTO.SendRequest
* @return ApiResponseDTO{@literal <KkopayDocDTO.SendResponse>}
*/
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
"document": {
"title": "문서 제목",
"read_expired_sec": 3600,
"hash": "6EFE827AC88914DE471C621AE",
"common_categories": [
"NOTICE"
],
"receiver": {
"phone_number": "01093414345",
"name": "김지호",
"birthday": "19831218",
"is_required_verify_name": false
},
"property": {
"link": "http://ip:8081/api/kakaopay/v1/ott",
"cs_number": "02-123-4567",
"cs_name": "콜센터",
"payload": "payload 파라미터 입니다.",
"message": "해당 안내문은 다음과 같습니다."
}
},
"signguCode": "88328",
"ffnlgCode": "11"
}
""")
})
})
@Operation(hidden = true, summary = "문서발송 요청", description = "카카오페이 전자문서 서버로 문서발송 처리를 요청")
@PostMapping(value = "/documents", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSend(
@RequestBody final SendRequest reqDTO
) {
return ApiResponseDTO.of(service.requestSend(reqDTO));
}
/**
* <pre>
* (Redirect URL /)
* </pre>
* @param reqDTO KkopayDocDTO.ValidTokenRequest
* @return ApiResponseDTO<KkopayDocDTO.ValidTokenResponse>
*/
@Operation(hidden = true, summary = "토큰 유효성 검증", description = "Redirect URL 접속 허용/불허")
@PostMapping(value = "/validToken", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse validToken(
@RequestBody final ValidTokenRequest reqDTO
) {
return ApiResponseDTO.of(service.validToken(reqDTO));
}
/**
* <pre>
* API
* -. . (OTT ) API .
* -.
* 1) API .
* 2) API(/v1/documents/{document_binder_uuid}/status) read_at ) .
* </pre>
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
* @return ApiResponseDTO<Void>
*/
@Operation(hidden = true, summary = "문서 상태 변경", description = "문서 상태 변경")
@PostMapping(value = "/modifyStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse modifyStatus(
@RequestBody final DocumentBinderUuid reqDTO
) {
return ApiResponseDTO.of(service.modifyStatus(reqDTO));
}
/**
* <pre>
* API
* -. .
* : , flow
* : polling , 5 .
* -.doc_box_status
* : SENT() > RECEIVED() > READ()/EXPIRED( )
* </pre>
* @param reqDTO KkopayDocAttrDTO.DocumentBinderUuid
* @return ApiResponseDTO<KkopayDocDTO.DocStatusResponse>
*/
@Operation(hidden = true, summary = "문서 상태 조회", description = "문서 상태 조회")
@PostMapping(value = "/findStatus", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findStatus(
@RequestBody final DocumentBinderUuid reqDTO
) {
return ApiResponseDTO.of(service.findStatus(reqDTO));
}
@Operation(hidden = true, summary = "대량 문서발송 요청", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청")
@PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSendBulk(
@RequestBody final BulkSendRequests reqDTO
) {
return ApiResponseDTO.of(service.requestSendBulk(reqDTO));
}
/**
* <pre>
*
* -. .
* </pre>
* @param reqDTO KkopayDocBulkDTO.BulkStatusRequests
* @return ApiResponseDTOApiResponseDTO<BulkStatusResponses.BulkStatusResponses>
*/
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(mediaType = "application/json", examples = {
@ExampleObject(value = "{\"document_binder_uuids\": [\n"
+ " \"BIN-883246dbff7b11edb3bb7affed8a016d\"\n"
+ " ]}")
})
})
@Operation(hidden = true, summary = "대량 문서 상태 조회 요청", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청")
@PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findBulkStatus(
@RequestBody final BulkStatusRequests reqDTO
) {
return ApiResponseDTO.of(service.findBulkStatus(reqDTO));
}
}

@ -11,8 +11,8 @@ import kr.xit.biz.ens.model.EnsKtBcDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.cmm.TmplatManage;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatus;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
/**
@ -331,7 +331,8 @@ public interface IEnsBatchMapper {
* @return int
* </pre>
*/
int updateKakaoStatusInfo(final BulkStatus dto);
// FIXME: kakao v1 or v2
int updateKakaoStatusInfo(final KkopayDocBulkDTO.BulkStatus dto);
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------
@ -380,5 +381,6 @@ public interface IEnsBatchMapper {
* @return EnsDTO.MobilePageManage
* </pre>
*/
EnsDTO.MobilePageManage selectKkoMobilePage(final OneTimeToken dto);
// FIXME: kakao v1 or v2
EnsDTO.MobilePageManage selectKkoMobilePage(final KkopayDocDTO.OneTimeToken dto);
}

@ -20,7 +20,7 @@ import kr.xit.biz.ens.mapper.IEnsBatchMapper;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.service.AbstractService;
@ -76,7 +76,8 @@ public class EnsBatchExtractService extends AbstractService implements
*/
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void saveKkoSendResult(final String mstId, String unitySndMstId, final List<BulkSendResponses> resList) {
// FIXME: kakao v1 or v2
public void saveKkoSendResult(final String mstId, String unitySndMstId, final List<KkopayDocBulkDTO.BulkSendResponses> resList) {
// 결과 반영
resList.forEach(o ->
o.getDocuments().forEach(

@ -30,11 +30,8 @@ import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.EnsDTO.SendKakaoTgt;
import kr.xit.biz.ens.model.EnsKtBcDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.PropertyBulk;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO.ErrorMsg;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
@ -123,6 +120,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
*/
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
// FIXME: kakao v1 or v2
public void sendBulks(final SndngMssageParam dto) {
dto.setProfile(ApiConstants.PROFILE);
@ -184,7 +182,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
if(list.isEmpty()) return;
final String mstId = list.get(0).getSndngMastrId();
final List<BulkSendReq> bulkList = setKkoMyDocSendBulks(list);
final List<KkopayDocBulkDTO.BulkSendReq> bulkList = setKkoMyDocSendBulks(list);
// validation check
try {
@ -194,13 +192,13 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
throw e;
}
final List<List<BulkSendReq>> partitions = ListUtils.partition(bulkList, bulkKkoMaxCnt);
final List<List<KkopayDocBulkDTO.BulkSendReq>> partitions = ListUtils.partition(bulkList, bulkKkoMaxCnt);
//noinspection rawtypes
final List<ApiResponseDTO> apiResults = partitions.stream()
.map(bulkSendList -> apiWebClient.exchange(
url,
HttpMethod.POST,
BulkSendRequests.builder()
KkopayDocBulkDTO.BulkSendRequests.builder()
.signguCode(dto.getSignguCode())
.ffnlgCode(dto.getFfnlgCode())
.documents(bulkSendList)
@ -210,13 +208,13 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
)
.toList();
final List<BulkSendResponses> resList = new ArrayList<>();
final List<KkopayDocBulkDTO.BulkSendResponses> resList = new ArrayList<>();
boolean isSuccess = false;
String errMsg = null;
//noinspection rawtypes
for(ApiResponseDTO apiResult : apiResults) {
if(apiResult.getData() != null) {
resList.add(toObjByObj(apiResult.getData(), BulkSendResponses.class));
resList.add(toObjByObj(apiResult.getData(), KkopayDocBulkDTO.BulkSendResponses.class));
isSuccess = true;
continue;
}
@ -235,16 +233,16 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
* @param list List<EnsDTO.SendKakaoTgt>
* @return List<KkopayDocBulkDTO.BulkSendReq>
*/
private static List<BulkSendReq> setKkoMyDocSendBulks(List<SendKakaoTgt> list) {
final List<BulkSendReq> bulkList = new ArrayList<>();
private static List<KkopayDocBulkDTO.BulkSendReq> setKkoMyDocSendBulks(List<SendKakaoTgt> list) {
final List<KkopayDocBulkDTO.BulkSendReq> bulkList = new ArrayList<>();
for (SendKakaoTgt sendTgtDTO : list) {
/*
: CI
*/
Receiver receiver = null;
KkopayDocAttrDTO.Receiver receiver = null;
if(StringUtils.isNotEmpty(sendTgtDTO.getCi())){
receiver = Receiver.builder()
receiver = KkopayDocAttrDTO.Receiver.builder()
.ci(sendTgtDTO.getCi())
.phone_number(StringUtils.EMPTY)
.name(StringUtils.EMPTY)
@ -252,7 +250,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
.is_required_verify_name(false)
.build();
}else{
receiver = Receiver.builder()
receiver = KkopayDocAttrDTO.Receiver.builder()
.phone_number(sendTgtDTO.getRecvPhoneNumber())
.name(sendTgtDTO.getRecvName())
.birthday(sendTgtDTO.getRecvBirthday())
@ -260,7 +258,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
.build();
}
final PropertyBulk property = PropertyBulk.builder()
final KkopayDocBulkDTO.PropertyBulk property = KkopayDocBulkDTO.PropertyBulk.builder()
.link(sendTgtDTO.getPropLink())
.payload(sendTgtDTO.getPropPayload())
.message(sendTgtDTO.getPropMessage())
@ -269,7 +267,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
.external_document_uuid(sendTgtDTO.getUnitySndngDetailId())
.build();
final BulkSendReq bulkReqDTO = BulkSendReq.builder()
final KkopayDocBulkDTO.BulkSendReq bulkReqDTO = KkopayDocBulkDTO.BulkSendReq.builder()
.title(sendTgtDTO.getTitle())
.common_categories(Collections.singletonList(ApiConstants.Categories.NOTICE))
.read_expired_at(sendTgtDTO.getClosDt())
@ -290,12 +288,12 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
*
* @param bulkList List<KkopayDocBulkDTO.BulkSendReq>
*/
private void validatedKkoMyDocSendBulks(List<BulkSendReq> bulkList) {
private void validatedKkoMyDocSendBulks(List<KkopayDocBulkDTO.BulkSendReq> bulkList) {
List<String> errors = new ArrayList<>();
int idx = 0;
for (BulkSendReq dto : bulkList) {
final Set<ConstraintViolation<BulkSendReq>> errList = validator.validate(dto);
for (KkopayDocBulkDTO.BulkSendReq dto : bulkList) {
final Set<ConstraintViolation<KkopayDocBulkDTO.BulkSendReq>> errList = validator.validate(dto);
if(!errList.isEmpty()) {
int finalIdx = idx;
@ -313,7 +311,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
errors.add("처리마감시간(절대시간 또는 상대시간)을 지정해야 합니다.");
}
final Receiver receiver = dto.getReceiver();
final KkopayDocAttrDTO.Receiver receiver = dto.getReceiver();
if (Checks.isEmpty(receiver.getCi())) {
if (Checks.isEmpty(receiver.getName())) {
errors.add(

@ -21,9 +21,8 @@ import kr.xit.biz.ens.mapper.IEnsBatchMapper;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocStatus;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.service.AbstractService;
@ -73,6 +72,7 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
*/
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
// FIXME: kakao v1 or v2
public void statusBulks(final EnsDTO.BatchEnsRequest reqDTO) {
final List<SndngMssageParam> tgtList = mapper.selectStatusBulkTgts(reqDTO);
@ -137,7 +137,7 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
.map(uuids -> apiWebClient.exchange(
url,
HttpMethod.POST,
BulkStatusRequests.builder()
KkopayDocBulkDTO.BulkStatusRequests.builder()
.signguCode(dto.getSignguCode())
.ffnlgCode(dto.getFfnlgCode())
.document_binder_uuids(uuids)
@ -146,11 +146,11 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
CmmEnsBizUtils.getHeadeMap())
).toList();
final List<BulkStatusResponses> resList = new ArrayList<>();
final List<KkopayDocBulkDTO.BulkStatusResponses> resList = new ArrayList<>();
//noinspection rawtypes
for(ApiResponseDTO apiResult : apiResults) {
if(apiResult.getData() != null) {
resList.add(toObjByObj(apiResult.getData(), BulkStatusResponses.class));
resList.add(toObjByObj(apiResult.getData(), KkopayDocBulkDTO.BulkStatusResponses.class));
}
}
@ -158,7 +158,7 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
resList.forEach(o ->
o.getDocuments().forEach(t -> {
mapper.updateKakaoStatusInfo(t);
DocStatus statusData = t.getStatus_data();
KkopayDocAttrDTO.DocStatus statusData = t.getStatus_data();
if(Checks.isNotEmpty(statusData)) {
mapper.updateCntcSndngResultByKkoMyDoc(CntcDTO.SndngResult.builder()
.documentBinderUuid(t.getDocument_binder_uuid())

@ -4,7 +4,7 @@ import java.util.List;
import kr.xit.biz.common.ApiConstants.SndngSeCode;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
/**
@ -29,7 +29,7 @@ public interface IEnsBatchExtractService {
//-----------------------------------------------------------------------------------------------------------------
// REQUIRES_NEW service method
//-----------------------------------------------------------------------------------------------------------------
void saveKkoSendResult(final String mstId, String unitySndMstId, final List<BulkSendResponses> resList);
void saveKkoSendResult(final String mstId, String unitySndMstId, final List<KkopayDocBulkDTO.BulkSendResponses> resList);
void saveKtBcResult(final SndngMssageParam dto, final List<KtMainSendReqData> sendReqs);

@ -1,25 +1,25 @@
package kr.xit.biz.ens.web;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.SendRequest;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocBulkDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.JsonUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <pre>
@ -91,7 +91,7 @@ public class ApiCallTestController {
@Operation(summary = "문서발송 요청", description = "카카오페이 전자문서 서버로 문서발송 처리를 요청")
@PostMapping(value = "/documents", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSend(
@RequestBody final SendRequest reqDTO
@RequestBody final KkopayDocDTO.SendRequest reqDTO
) {
StringBuilder url = new StringBuilder()
.append("http://localhost:8081")
@ -150,7 +150,7 @@ public class ApiCallTestController {
})
@PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSendBulk(
@RequestBody final BulkSendRequests reqDTO
@RequestBody final KkopayDocBulkDTO.BulkSendRequests reqDTO
) {
final String url = apiHost + apiBulkSend;
@ -186,7 +186,7 @@ public class ApiCallTestController {
@Operation(summary = "대량 문서 상태 조회 요청", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청")
@PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findBulkStatus(
@RequestBody final BulkStatusRequests reqDTO
@RequestBody final KkopayDocBulkDTO.BulkStatusRequests reqDTO
) {
final String url = apiHost + apiBulkStatus;;

@ -175,13 +175,13 @@
<select id="selectMakeTgts" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
/** ens-mysql-mapper|selectMakeTgts-통합발송 생성 대상 조회|julim */
SELECT unity_sndng_mastr_id
, tmplat_id
, sndng_co
, tmplat_id
, sndng_co
, try1
, try2
, try3
, try_cnt
, sndng_process_sttus
, sndng_process_sttus
, signgu_code
, ffnlg_code
FROM tb_ens_unity_sndng_mastr

@ -1,11 +1,16 @@
package kr.xit.biz.ens.model.kakao;
package kr.xit.biz.ens.model.kakao.v1;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotEmpty;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.model.IApiResponse;
@ -14,13 +19,12 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotEmpty;
/**
* <pre>
* description : DTO
*
* packageName : kr.xit.biz.ens.model.kakao
* packageName : kr.xit.biz.ens.model.kakao.v1
* fileName : KkopayDocAttrDTO
* author : limju
* date : 2023-05-03

@ -1,23 +1,27 @@
package kr.xit.biz.ens.model.kakao;
package kr.xit.biz.ens.model.kakao.v1;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotEmpty;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotEmpty;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.ens.model.kakao
* packageName : kr.xit.biz.ens.model.kakao.v1
* fileName : KkopayDocBulkDTO
* author : limju
* date : 2023-05-12

@ -1,10 +1,15 @@
package kr.xit.biz.ens.model.kakao;
package kr.xit.biz.ens.model.kakao.v1;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.Valid;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor;
@ -13,14 +18,12 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/**
* <pre>
* description : DTO
*
* packageName : kr.xit.ens.model.kakao
* packageName : kr.xit.ens.model.kakao.v1
* fileName : KkopayDocDTO
* author : limju
* date : 2023-05-03
@ -52,7 +55,7 @@ public class KkopayDocDTO extends KkopayDocAttrDTO {
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
public static class RequestSend extends KkopayDocAttrDTO.Send {
public static class RequestSend extends Send {
/**
* -
*/

@ -1,10 +1,11 @@
package kr.xit.biz.ens.model.kakao;
package kr.xit.biz.ens.model.kakao.v1;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.Size;
import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -15,7 +16,7 @@ import lombok.experimental.SuperBuilder;
* <pre>
* description :
*
* packageName : kr.xit.biz.ens.model.kakao
* packageName : kr.xit.biz.ens.model.kakao.v1
* fileName : KkopayErrorDTO
* author : limju
* date : 2023-06-01
Loading…
Cancel
Save