feat: 카카오톡/페이 모바일 페이지 호출 반영

main
Jonguk. Lim 3 months ago
parent acdd202de2
commit b13dd3221c

@ -3,7 +3,7 @@ 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.v1.KkopayDocDTO;
import kr.xit.biz.mbl.model.MobilePageDTO;
import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage;
/**
@ -24,7 +24,7 @@ import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage;
@Mapper
public interface IMobilePageMapper {
// FIXME: kakao v1 or v2
MobilePageManage selectKkoMobilePage(final KkopayDocDTO.OneTimeToken dto);
MobilePageManage selectKkoMobilePage(final MobilePageDTO.KakaoValidTokenRequest dto);
<T> MobilePageManage selectKtMobilePage(final T t);
MobilePageManage selectXitMobilePage(final CntcDTO.XitPage dto);
}

@ -1,9 +1,14 @@
package kr.xit.biz.mbl.model;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -64,4 +69,36 @@ public class MobilePageDTO {
*/
private String register;
}
@Schema(name = "KakaoValidTokenRequest DTO", description = "카카오페이/톡 전자문서 토큰 유효성 검증 파라메터 DTO")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public static class KakaoValidTokenRequest {
/**
* ID
*/
private String envelopeId;
/**
* ID
*/
private String externalId;
/**
*
*/
private String documentBinderUuid;
/**
* ( - max:40)
*/
private String externalDocumentUuid;
/**
* / :
*/
private String token;
}
}

@ -1,8 +1,8 @@
package kr.xit.biz.mbl.service;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO.KtTokenConfirmRequest;
import kr.xit.biz.mbl.model.MobilePageDTO;
import kr.xit.core.model.IApiResponse;
/**
@ -22,9 +22,10 @@ import kr.xit.core.model.IApiResponse;
*/
public interface IMobilePageService {
// FIXME: kakao v1 or v2
IApiResponse findKkoMyDocReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO);
IApiResponse findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO);
IApiResponse findKkotalkReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO);
IApiResponse findKtMblPage(final KtTokenConfirmRequest reqDTO);
IApiResponse findXitMyDocReadyAndMblPage(final CntcDTO.XitPage reqDTO);
IApiResponse findXitkkopayReadyAndMblPage(final CntcDTO.XitPage reqDTO);
}

@ -4,9 +4,11 @@ import org.springframework.stereotype.Service;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kakao.v2.KkotalkApiDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.mbl.mapper.IMobilePageMapper;
import kr.xit.biz.mbl.model.MobilePageDTO;
import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage;
import kr.xit.core.consts.ErrorCode;
import kr.xit.core.exception.BizRuntimeException;
@ -16,6 +18,7 @@ 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.v1.service.IKkopayEltrcDocService;
import kr.xit.ens.kakao.v2.service.IKkotalkEltrcDocService;
import kr.xit.ens.kt.service.IKtBcService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -40,7 +43,8 @@ import lombok.extern.slf4j.Slf4j;
@Service
public class MobilePageService extends AbstractService implements IMobilePageService {
private final IMobilePageMapper mapper;
private final IKkopayEltrcDocService kkoService;
private final IKkopayEltrcDocService kkopayService;
private final IKkotalkEltrcDocService kkotalkService;
private final IKtBcService ktMmsService;
/**
@ -60,18 +64,62 @@ public class MobilePageService extends AbstractService implements IMobilePageSer
*/
@Override
@TraceLogging
public IApiResponse findKkoMyDocReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO) {
public IApiResponse findKkopayReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO) {
if (Checks.isEmpty(reqDTO.getToken()) || Checks.isEmpty(reqDTO.getDocument_binder_uuid()) || Checks.isEmpty(reqDTO.getExternal_document_uuid()))
if (Checks.isEmpty(reqDTO.getToken()) || Checks.isEmpty(reqDTO.getDocumentBinderUuid()) || Checks.isEmpty(reqDTO.getExternalDocumentUuid()))
throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
// document_binder_uuid와 external_document_uuid로 데이타 검증
final MobilePageManage mobilePageManage = mapper.selectKkoMobilePage(reqDTO);
if(mobilePageManage == null) throw BizRuntimeException.create("데이타 오류[내문서함 문서가 없습니다]");
if(mobilePageManage == null) throw BizRuntimeException.create("데이타 오류[카카오페이 내문서함 문서가 없습니다]");
final ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> res = kkopayService.findKkopayReadyAndMblPage(
KkopayDocDTO.OneTimeToken.builder()
.document_binder_uuid(reqDTO.getDocumentBinderUuid())
.external_document_uuid(reqDTO.getExternalDocumentUuid())
.token(reqDTO.getToken())
.signguCode(mobilePageManage.getSignguCode())
.ffnlgCode(mobilePageManage.getFfnlgCode())
.build()
);
if(!res.isSuccess()){
return res;
}
return ApiResponseDTO.success(mobilePageManage.getMobilePageCn());
}
/**
* <pre>
* </h3>
* - : (bulks-) document_binder_uuid
* - redirect url
* ->
* -> > >
*
*
* 1. (redirect url /
* 2.
*
* @param reqDTO KkopayDocDTO.OneTimeToken
* </pre>
*/
@Override
@TraceLogging
public IApiResponse findKkotalkReadyAndMblPage(MobilePageDTO.KakaoValidTokenRequest reqDTO) {
reqDTO.setSignguCode(mobilePageManage.getSignguCode());
reqDTO.setFfnlgCode(mobilePageManage.getFfnlgCode());
if (Checks.isEmpty(reqDTO.getToken()) || Checks.isEmpty(reqDTO.getEnvelopeId()) || Checks.isEmpty(reqDTO.getExternalId()))
throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
// document_binder_uuid와 external_document_uuid로 데이타 검증
final MobilePageManage mobilePageManage = mapper.selectKkoMobilePage(reqDTO);
if(mobilePageManage == null) throw BizRuntimeException.create("데이타 오류[카카오톡 내문서함 문서가 없습니다]");
final ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> res = kkoService.findMyDocReadyAndMblPage(reqDTO);
final ApiResponseDTO<KkotalkApiDTO.ValidTokenResponse> res = kkotalkService.findKkotalkReadyAndMblPage(
KkotalkApiDTO.ValidTokenRequest.builder()
.envelopeId(reqDTO.getEnvelopeId())
.token(reqDTO.getToken())
.signguCode(mobilePageManage.getSignguCode())
.ffnlgCode(mobilePageManage.getFfnlgCode())
.build()
);
if(!res.isSuccess()){
return res;
}
@ -138,7 +186,7 @@ public class MobilePageService extends AbstractService implements IMobilePageSer
*/
@Override
@TraceLogging
public IApiResponse findXitMyDocReadyAndMblPage(final CntcDTO.XitPage reqDTO) {
public IApiResponse findXitkkopayReadyAndMblPage(final CntcDTO.XitPage reqDTO) {
// unitySndngDetailId로 데이타 조회
final MobilePageManage mobilePageManage = mapper.selectXitMobilePage(reqDTO);

@ -14,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.v1.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.mbl.model.MobilePageDTO;
import kr.xit.biz.mbl.service.IMobilePageService;
import kr.xit.core.model.IApiResponse;
import lombok.RequiredArgsConstructor;
@ -38,7 +38,7 @@ import lombok.RequiredArgsConstructor;
@Tag(name = "MobilePageController", description = "전자문서 중개자 모바일 페이지 API Controller")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/biz/mbl/v1")
@RequestMapping(value = "/api/biz/mbl")
public class MobilePageController {
private final IMobilePageService service;
@ -52,9 +52,16 @@ public class MobilePageController {
* </pre>
*/
@Operation(summary = "카카오 모바일 데이타 요청(모바일 페이지에서 호출)", description = "카카오 모바일 데이타 요청(모바일 페이지에서 호출)")
@PostMapping(value = "/kko/mblPage", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findKkoMyDocReadyAndMblData(@RequestBody final KkopayDocDTO.OneTimeToken reqDTO) {
return service.findKkoMyDocReadyAndMblPage(reqDTO);
@PostMapping(
value = {"/kkopay/mblPage", "/kkotalk/mblPage"}, produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findKkoMyDocReadyAndMblData(@RequestBody final MobilePageDTO.KakaoValidTokenRequest reqDTO, final HttpServletRequest request) {
final String uri = request.getRequestURI();
if(uri.contains("/kkopay/mblPage")) {
return service.findKkopayReadyAndMblPage(reqDTO);
}else{
return service.findKkotalkReadyAndMblPage(reqDTO);
}
}
/**
@ -109,6 +116,6 @@ public class MobilePageController {
@Operation(summary = "XIT 모바일 데이타 요청(모바일 페이지에서 호출)", description = "XIT 모바일 데이타 요청(모바일 페이지에서 호출)")
@PostMapping(value = "/xit/mblPage", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findXitMyDocReadyAndMblData(@RequestBody final CntcDTO.XitPage reqDTO) {
return service.findXitMyDocReadyAndMblPage(reqDTO);
return service.findXitkkopayReadyAndMblPage(reqDTO);
}
}

@ -92,6 +92,6 @@ public interface IKkopayEltrcDocService {
KkopayDocBulkDTO.BulkStatusResponses findBulkStatus(final KkopayDocBulkDTO.BulkStatusRequests reqDTO);
ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO);
ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findKkopayReadyAndMblPage(KkopayDocDTO.OneTimeToken reqDTO);
}

@ -258,7 +258,7 @@ public class KkopayEltrcDocService extends AbstractService implements
}
@Override
public ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(final KkopayDocDTO.OneTimeToken reqDTO) {
public ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findKkopayReadyAndMblPage(final KkopayDocDTO.OneTimeToken reqDTO) {
final String url = HOST + API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
.replace("{tokens}", reqDTO.getToken());

@ -90,6 +90,6 @@ public interface IKkotalkEltrcDocService {
KkotalkDTO.BulkStatusResponse findBulkStatus(final KkotalkDTO.BulkStatusRequest reqDTO);
ApiResponseDTO<KkotalkApiDTO.ValidTokenResponse> findMyDocReadyAndMblPage(KkotalkApiDTO.ValidTokenRequest reqDTO);
ApiResponseDTO<KkotalkApiDTO.ValidTokenResponse> findKkotalkReadyAndMblPage(KkotalkApiDTO.ValidTokenRequest reqDTO);
}

@ -282,7 +282,7 @@ public class KkotalkEltrcDocService extends AbstractService implements
}
@Override
public ApiResponseDTO<KkotalkApiDTO.ValidTokenResponse> findMyDocReadyAndMblPage(final KkotalkApiDTO.ValidTokenRequest reqDTO) {
public ApiResponseDTO<KkotalkApiDTO.ValidTokenResponse> findKkotalkReadyAndMblPage(final KkotalkApiDTO.ValidTokenRequest reqDTO) {
final String url = HOST + API_VALID_TOKEN[0].replace(ENVELOPE_ID, reqDTO.getEnvelopeId())
.replace("{TOKEN}", reqDTO.getToken());

@ -3,8 +3,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.biz.mbl.mapper.IMobilePageMapper">
<select id="selectKkoMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-mysql-mapper|selectKkoMobilePage-카카오 모바일 페이지 콘텐트 조회|julim */
<select id="selectKkopayMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-mysql-mapper|selectKkopayMobilePage-카카오페이 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id
, tempm.sndng_se_code
, tempm.mobile_page_cn
@ -17,6 +17,20 @@
AND tekmd.document_binder_uuid = #{document_binder_uuid}
</select>
<select id="selectKkotalkMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-mysql-mapper|selectKkotalkMobilePage-카카오톡 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id
, tempm.sndng_se_code
, tempm.mobile_page_cn
, tekmd.signgu_code
, tekmd.ffnlg_code
FROM tb_ens_kakao_d10 tekmd
JOIN tb_ens_mobile_page_manage tempm
ON tekmd.sndng_detail_id = tempm.sndng_detail_id
WHERE tekmd.envelope_id = #{envelopeId}
AND tekmd.external_id = #{externalId}
</select>
<select id="selectKtMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-mysql-mapper|selectKtMobilePage-KT 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.biz.mbl.mapper.IMobilePageMapper">
<select id="selectKkopayMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-oracle-mapper|selectKkopayMobilePage-카카오페이 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id
, tempm.sndng_se_code
, tempm.mobile_page_cn
, tekmd.signgu_code
, tekmd.ffnlg_code
FROM tb_ens_kakao_my_doc tekmd
JOIN tb_ens_mobile_page_manage tempm
ON tekmd.sndng_detail_id = tempm.sndng_detail_id
WHERE tekmd.external_document_uuid = #{external_document_uuid}
AND tekmd.document_binder_uuid = #{document_binder_uuid}
</select>
<select id="selectKkotalkMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-oracle-mapper|selectKkotalkMobilePage-카카오톡 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id
, tempm.sndng_se_code
, tempm.mobile_page_cn
, tekmd.signgu_code
, tekmd.ffnlg_code
FROM tb_ens_kakao_d10 tekmd
JOIN tb_ens_mobile_page_manage tempm
ON tekmd.sndng_detail_id = tempm.sndng_detail_id
WHERE tekmd.envelope_id = #{envelopeId}
AND tekmd.external_id = #{externalId}
</select>
<select id="selectKtMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-oracle-mapper|selectKtMobilePage-KT 모바일 페이지 콘텐트 조회|julim */
SELECT tempm.sndng_detail_id
, tempm.sndng_se_code
, tempm.mobile_page_cn
FROM tb_ens_kt_bc_detail tekbd
JOIN tb_ens_mobile_page_manage tempm
ON tekbd.sndng_detail_id = tempm.sndng_detail_id
WHERE tekbd.src_key = #{srcKey}
</select>
<select id="selectXitMobilePage" resultType="kr.xit.biz.mbl.model.MobilePageDTO$MobilePageManage">
/** ens-mbl-oracle-mapper|selectXitMobilePage-XIT 모바일 페이지 콘텐트 조회|jhseo */
SELECT tempm.mobile_page_cn
FROM tb_ens_mobile_page_manage tempm
WHERE sndng_detail_id = #{unitySndngDetailId}
</select>
</mapper>
Loading…
Cancel
Save