refactor: 패키지 정리

dev
gitea-관리자 1 year ago
parent e1f37bbe5f
commit 49e964378c

@ -1,10 +0,0 @@
/**
* ENS business packages
* <p>
* : ens
* </p>
* @since 1.0
* @author limju
* @version 1.0
*/
package kr.xit.biz.ens;

@ -1,14 +1,14 @@
package kr.xit.biz.ens.mapper;
package kr.xit.biz.kakao.mapper;
import kr.xit.biz.ens.model.KkoMyDocDTO.MobilePageManage;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.kakao.model.KkoMyDocDTO.MobilePageManage;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
/**
* <pre>
* description : API mapper
*
* packageName : kr.xit.biz.ens.mapper
* packageName : kr.xit.biz.kakao.mapper
* fileName : IKkoMyDocMapper
* author : limju
* date : 2023-08-31

@ -1,19 +1,20 @@
package kr.xit.biz.ens.model;
import java.io.Serializable;
import java.time.LocalDateTime;
package kr.xit.biz.kakao.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import lombok.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <pre>
* description : DTO
*
* packageName : kr.xit.biz.ens.model
* packageName : kr.xit.biz.kakao.model
* fileName : KkoMyDocDTO
* author : limju
* date : 2023-08-31

@ -0,0 +1,10 @@
/**
* kakao ENS business packages
* <p>
* : kakao
* </p>
* @since 1.0
* @author limju
* @version 1.0
*/
package kr.xit.biz.kakao;

@ -1,4 +1,4 @@
package kr.xit.biz.ens.service;
package kr.xit.biz.kakao.service;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.core.model.ApiResponseDTO;
@ -7,7 +7,7 @@ import kr.xit.core.model.ApiResponseDTO;
* <pre>
* description : API Service Interface
*
* packageName : kr.xit.biz.ens.service
* packageName : kr.xit.biz.kakao.service
* fileName : IKkoMyDocService
* author : limju
* date : 2023-08-31

@ -1,24 +1,23 @@
package kr.xit.biz.ens.service;
package kr.xit.biz.kakao.service;
import kr.xit.biz.ens.mapper.IKkoMyDocMapper;
import kr.xit.biz.ens.model.KkoMyDocDTO.MobilePageManage;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.kakao.mapper.IKkoMyDocMapper;
import kr.xit.biz.kakao.model.KkoMyDocDTO.MobilePageManage;
import kr.xit.core.consts.ErrorCode;
import kr.xit.ens.support.kakao.service.IKkopayEltrcDocService;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.support.utils.Checks;
import kr.xit.ens.kakao.service.IKkopayEltrcDocService;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
/**
* <pre>
* description : API Service
*
* packageName : kr.xit.biz.ens.service
* packageName : kr.xit.biz.kakao.service
* fileName : KkoMyDocService
* author : limju
* date : 2023-08-31

@ -1,9 +1,9 @@
package kr.xit.biz.ens.web;
package kr.xit.biz.kakao.web;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.service.IKkoMyDocService;
import kr.xit.biz.kakao.service.IKkoMyDocService;
import kr.xit.core.model.ApiResponseDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
* <pre>
* description : API Controller
*
* packageName : kr.xit.biz.ens.web
* packageName : kr.xit.biz.kakao.web
* fileName : KkoMyDocController
* author : limju
* date : 2023-08-31
@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "KkoMyDocController", description = "카카오페이 전자문서 API Controller")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/ens/v1")
@RequestMapping(value = "/api/biz/kakao/v1")
public class KkoMyDocController {
private final IKkoMyDocService service;

@ -1,4 +1,4 @@
package kr.xit.ens.support.cmm.mapper;
package kr.xit.ens.cmm.mapper;
import kr.xit.biz.ens.model.nice.NiceCiDTO.CrtfInfo;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
@ -8,7 +8,7 @@ import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
* description : mapper
* - cache: CaffeineCache use
*
* packageName : kr.xit.ens.support.cmm.mapper
* packageName : kr.xit.ens.cmm.mapper
* fileName : ICmmEnsMapper
* author : limju
* date : 2023-09-12

@ -1,9 +1,9 @@
package kr.xit.ens.support.cmm.service;
package kr.xit.ens.cmm.service;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.stats.CacheStats;
import kr.xit.biz.ens.model.nice.NiceCiDTO.CrtfInfo;
import kr.xit.ens.support.cmm.mapper.ICmmEnsMapper;
import kr.xit.ens.cmm.mapper.ICmmEnsMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.CacheManager;

@ -1,4 +1,4 @@
package kr.xit.ens.support.cmm.service;
package kr.xit.ens.cmm.service;
import java.io.IOException;
import java.io.InputStream;
@ -29,7 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.cmm.service
* packageName : kr.xit.ens.cmm.service
* fileName : CmmEnsFileService
* author : limju
* date : 2023-09-05
@ -43,7 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
@Slf4j
@RequiredArgsConstructor
@Service
public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEnsFileService{
public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEnsFileService {
private final static int FMC_EXCEL_DATA_START_ROW = 3;
private final static int FMC_EXCEL_CELL_CNT = 7;

@ -1,4 +1,4 @@
package kr.xit.ens.support.cmm.service;
package kr.xit.ens.cmm.service;
import kr.xit.biz.ens.model.nice.NiceCiDTO.CrtfInfo;
@ -6,7 +6,7 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.CrtfInfo;
* <pre>
* description : CaffeineCache
*
* packageName : kr.xit.ens.support.cmm.service
* packageName : kr.xit.ens.cmm.service
* fileName : ICmmEnsCacheService
* author : limju
* date : 2023-09-12

@ -1,4 +1,4 @@
package kr.xit.ens.support.cmm.service;
package kr.xit.ens.cmm.service;
import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload;
@ -6,7 +6,7 @@ import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.cmm.service
* packageName : kr.xit.ens.cmm.service
* fileName : ICmmEnsFileService
* author : limju
* date : 2023-09-05

@ -1,10 +1,10 @@
package kr.xit.ens.support.cmm.web;
package kr.xit.ens.cmm.web;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.ens.support.cmm.service.ICmmEnsFileService;
import kr.xit.ens.cmm.service.ICmmEnsFileService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.cmm.web
* packageName : kr.xit.ens.cmm.web
* fileName : CmmFileMgtController
* author : limju
* date : 2023-09-04
@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "CmmEnsFileController", description = "전자고지 연계 파일 관련 처리")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/cmm")
@RequestMapping(value = "/api/ens/cmm")
public class CmmEnsFileController {
private final ICmmEnsFileService service;

@ -1,4 +1,4 @@
package kr.xit.ens.support.kakao.service;
package kr.xit.ens.kakao.service;
import java.util.ArrayList;
import java.util.List;
@ -6,11 +6,9 @@ import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
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;
@ -23,25 +21,24 @@ 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.core.spring.util.ApiWebClientUtil;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
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.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
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 lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
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.support.kakao.service
* packageName : kr.xit.ens.kakao.service
* fileName : KkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -56,7 +53,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@Component
public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implements IAsyncKkopayEltrcDocService {
public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implements
IAsyncKkopayEltrcDocService {
@Value("${contract.kakao.host}")
private String HOST;

@ -1,15 +1,11 @@
package kr.xit.ens.support.kakao.service;
package kr.xit.ens.kakao.service;
import java.util.concurrent.CompletableFuture;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO;
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;
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;
@ -20,7 +16,7 @@ import kr.xit.core.model.ApiResponseDTO;
/**
* <pre>
* description :
* packageName : kr.xit.ens.support.kakao.service
* packageName : kr.xit.ens.kakao.service
* fileName : IKkopayEltrcDocService
* author : julim
* date : 2023-04-28

@ -1,13 +1,10 @@
package kr.xit.ens.support.kakao.service;
package kr.xit.ens.kakao.service;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO;
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;
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;
@ -19,7 +16,7 @@ import kr.xit.core.model.ApiResponseDTO;
/**
* <pre>
* description :
* packageName : kr.xit.ens.support.kakao.service
* packageName : kr.xit.ens.kakao.service
* fileName : IKkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -103,6 +100,6 @@ public interface IKkopayEltrcDocService {
BulkStatusResponses findBulkStatus(final BulkStatusRequests reqDTO);
ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(OneTimeToken reqDTO);
ApiResponseDTO<ValidTokenResponse> findMyDocReadyAndMblPage(OneTimeToken reqDTO);
}

@ -1,11 +1,13 @@
package kr.xit.ens.support.kakao.service;
package kr.xit.ens.kakao.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
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;
@ -13,7 +15,6 @@ 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;
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;
@ -28,24 +29,18 @@ 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 lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
/**
* <pre>
* description :
* packageName : kr.xit.ens.support.kakao.service
* packageName : kr.xit.ens.kakao.service
* fileName : KkopayEltrcDocService
* author : julim
* date : 2023-04-28
@ -59,7 +54,8 @@ import javax.validation.Validator;
@Slf4j
@RequiredArgsConstructor
@Component
public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements IKkopayEltrcDocService {
public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
IKkopayEltrcDocService {
@Value("${contract.kakao.host}")
private String HOST;
@ -262,7 +258,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements IK
}
@Override
public ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> findMyDocReadyAndMblPage(OneTimeToken reqDTO) {
public ApiResponseDTO<ValidTokenResponse> findMyDocReadyAndMblPage(OneTimeToken reqDTO) {
String url = HOST + API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
.replace("{tokens}", reqDTO.getToken());

@ -1,26 +1,28 @@
package kr.xit.ens.support.kakao.web;
package kr.xit.ens.kakao.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.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 org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
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.core.model.ApiResponseDTO;
import kr.xit.ens.support.kakao.service.IAsyncKkopayEltrcDocService;
import kr.xit.ens.kakao.service.IAsyncKkopayEltrcDocService;
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.support.kakao.web
* packageName : kr.xit.ens.kakao.web
* fileName : AsyncKkopayEltrcDocController
* author : julim
* date : 2023-04-28
@ -35,7 +37,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/kakaopay/v2")
@RequestMapping(value = "/api/ens/kakao/v2")
public class AsyncKkopayEltrcDocController {
private final IAsyncKkopayEltrcDocService service;

@ -1,4 +1,4 @@
package kr.xit.ens.support.kakao.web;
package kr.xit.ens.kakao.web;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
@ -10,19 +10,20 @@ 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 org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import kr.xit.ens.support.kakao.service.IKkopayEltrcDocService;
import kr.xit.ens.kakao.service.IKkopayEltrcDocService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
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.support.kakao.web
* packageName : kr.xit.ens.kakao.web
* fileName : KkopayEltrcDocController
* author : julim
* date : 2023-04-28
@ -37,7 +38,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/kakaopay/v1")
@RequestMapping(value = "/api/ens/kakao/v1")
public class KkopayEltrcDocController {
@Value("${contract.kakao.token}")
private String accessToken;

@ -1,4 +1,4 @@
package kr.xit.ens.support.nice.service;
package kr.xit.ens.nice.service;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
@ -7,12 +7,13 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegResDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
/**
* <pre>
* description :
*
* packageName : kr.xit.ens.support.nice.service
* packageName : kr.xit.ens.nice.service
* fileName : INiceCiService
* author : limju
* date : 2023-09-06
@ -28,7 +29,7 @@ public interface INiceCiService {
// 기관용 Token
//--------------------------------------------------------------------------------
TokenResponse generateToken(final TokenRequest reqDTO);
TokenResponse revokeToken();
TokenRevokeResponse revokeToken();
//--------------------------------------------------------------------------------
// 기관용 Token
//--------------------------------------------------------------------------------
@ -36,7 +37,7 @@ public interface INiceCiService {
//--------------------------------------------------------------------------------
// 공개키(Publickey)
//--------------------------------------------------------------------------------
PublickeyResponse requestPublickey(final PublickeyRequest reqDTO);
PublickeyResponse requestPublickey();
//--------------------------------------------------------------------------------
// 공개키(Publickey)
//--------------------------------------------------------------------------------
@ -44,7 +45,7 @@ public interface INiceCiService {
//--------------------------------------------------------------------------------
// 대칭키 : symmetrickey
//--------------------------------------------------------------------------------
SymmetrickeyRegResponse requestRegSymmetrickey(SymmetrickeyRegRequest reqDTO);
SymmetrickeyRegResponse requestRegSymmetrickey();
//--------------------------------------------------------------------------------
// 대칭키 : symmetrickey
//--------------------------------------------------------------------------------

@ -1,4 +1,4 @@
package kr.xit.ens.support.nice.service;
package kr.xit.ens.nice.service;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@ -13,9 +13,12 @@ import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import kr.xit.biz.ens.model.nice.NiceCiDTO.CrtfInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyReqDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.RequestDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenResDataBody;
@ -25,7 +28,10 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.DateUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
@ -38,7 +44,7 @@ import org.springframework.util.Base64Utils;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.nice.service
* packageName : kr.xit.ens.nice.service
* fileName : NiceCiService
* author : limju
* date : 2023-09-06
@ -50,6 +56,7 @@ import org.springframework.util.Base64Utils;
* </pre>
*/
//FIXME : client_id, client_secret, access_token DB 처리후 반영 필요
@Slf4j
@RequiredArgsConstructor
@Service
public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
@ -73,8 +80,11 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
@Value("${contract.nice.api.ci}")
private String API_CI;
private final int EXPIRED_CHECK_DAYS = 1;
private static final String AUTH_TYPE_BASIC = "Basic";
private static final String AUTH_TYPE_BEARER = "bearer";
private static final String CNTY_CD = "kr";
private static final String PUB_KEY_REQ_TRAN_ID_PREFIX = "TRAN_ID-";
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private final ApiWebClientUtil webClient;
@ -91,15 +101,6 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
@TraceLogging
public TokenResponse generateToken(final TokenRequest reqDTO){
validate(reqDTO);
Map<String,String> map = new HashMap<>();
map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
map.put(HttpHeaders.AUTHORIZATION,
String.format("%s %s", AUTH_TYPE_BASIC,
Base64Utils.encodeToString(
Base64Utils.encode(String.format("%s:%s", this.CLIENT_ID, "this.CLIENT_SECRET").getBytes(StandardCharsets.UTF_8))
)
)
);
return TokenResponse.builder()
.dataHeader(ResponseDataHeader.builder()
@ -147,15 +148,26 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
// 공개키(Publickey)
//--------------------------------------------------------------------------------
public PublickeyResponse requestPublickey(final PublickeyRequest reqDTO) {
validate(reqDTO);
public PublickeyResponse requestPublickey() {
final String todayDt = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss");
final PublickeyRequest pubReqDTO = PublickeyRequest.builder()
.dataHeader(RequestDataHeader.builder()
.cntyId(CNTY_CD)
.tranId(String.format("%s%s", PUB_KEY_REQ_TRAN_ID_PREFIX, todayDt))
.build())
.dataBody(PublickeyReqDataBody.builder()
.reqDtim(todayDt)
.build())
.build();
log.debug("{}", pubReqDTO);
validate(pubReqDTO);
return PublickeyResponse.builder()
.dataHeader(ResponseDataHeader.builder()
.gwRsltCd("1200")
.gwRsltMsg("오류없음")
.tranId(reqDTO.getDataHeader().getTranId())
.cntyId(reqDTO.getDataHeader().getCntyId())
.tranId(pubReqDTO.getDataHeader().getTranId())
.cntyId(pubReqDTO.getDataHeader().getCntyId())
.build())
.dataBody(PublickeyResDataBody.builder()
.rspCd("P000")
@ -174,25 +186,6 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
//--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
private Map<String,String> getHeaderMap(final String contentType, final String type){
Map<String,String> map = new HashMap<>();
map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
map.put(
HttpHeaders.AUTHORIZATION,
String.format("%s %s",
type,
Base64Utils.encodeToString(
Base64Utils.encode(
String.format("%s:%s:%s",
"accessToken",
(new Date().getTime() / 1000),
this.CLIENT_ID).getBytes(StandardCharsets.UTF_8))
)
)
);
return map;
}
private static <T> void validate(T t) {
Set<ConstraintViolation<T>> list = validator.validate(t);
@ -207,4 +200,27 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
.collect(Collectors.toList()).toString());
}
}
private CrtfInfo getNiceCrtInfo() {
return CrtfInfo.builder()
.signguCode("11000")
.ffnlgCode("11")
.clientId("6c3eb1ff-530d-458a-9a6e-e02e3346f679")
.clientSecret("960f204ec45bb312b7ad2d6b54b984d9c353b8")
.productId("2101466024")
.accessToken("ff5e27fe-8b5d-49db-ab1e-0ccf07de6ac1")
.expiresIn(1576983050)
.tokenType("bearer")
.scope("default")
.siteCode("AAAA==")
.keyVersion("20210121ca8c1612-2c2d-IPaa-aad1-xxxxxxxxxxxx")
.publicKey("MIIBIjANBgkqhkiG9w0BAQEFAA.....JJxwIDAQAB...")
.validDtim("20220121181550")
.remainingDays(2)
.build();
}
private CrtfInfo getPublickeyCrtInfo(RequestDataHeader reqHeader){
return getNiceCrtInfo();
}
}

@ -1,9 +1,11 @@
package kr.xit.ens.support.nice.service;
package kr.xit.ens.nice.service;
import egovframework.com.cmm.EgovMessageSource;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
@ -11,7 +13,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.stream.Collectors;
import javax.crypto.BadPaddingException;
@ -28,17 +29,21 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.RequestDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegReqDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.DateUtils;
import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.support.cmm.mapper.ICmmEnsMapper;
import kr.xit.ens.support.cmm.service.CmmEnsCacheService;
import kr.xit.core.support.utils.UUIDGenerateUtils;
import kr.xit.ens.cmm.mapper.ICmmEnsMapper;
import kr.xit.ens.cmm.service.CmmEnsCacheService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
@ -55,7 +60,7 @@ import org.springframework.util.Base64Utils;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.nice.service
* packageName : kr.xit.ens.nice.service
* fileName : NiceCiService
* author : limju
* date : 2023-09-06
@ -92,12 +97,15 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
private String API_CI;
//FIXME::업무처리 최대 주기
private final int EXPIRED_CHECK_DAYS = 1;
private final int EXPIRED_CHECK_DAYS = 0;
private static final String AUTH_TYPE_BASIC = "Basic";
private static final String AUTH_TYPE_BEARER = "bearer";
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private static final String CNTY_CD = "kr";
private static final String TRAN_ID_PREFIX = "TRAN_ID-";
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private final EgovMessageSource messageSource;
private final ApiWebClientUtil webClient;
private final CmmEnsCacheService cacheService;
private final ICmmEnsMapper cmmEnsMapper;
@ -117,10 +125,12 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
public TokenResponse generateToken(final TokenRequest reqDTO){
validate(reqDTO);
CrtfInfo niceDTO = getNiceCrtInfo();
Map<String,String> map = new HashMap<>();
map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
map.put(HttpHeaders.AUTHORIZATION,
String.format("%s %s", AUTH_TYPE_BASIC, Base64Utils.encodeToString(Base64Utils.encode(String.format("%s:%s", this.CLIENT_ID, "this.CLIENT_SECRET").getBytes(StandardCharsets.UTF_8)))));
String.format("%s %s", AUTH_TYPE_BASIC, Base64Utils.encodeToString(Base64Utils.encode(String.format("%s:%s", CLIENT_ID, niceDTO.getClientSecret()).getBytes(StandardCharsets.UTF_8)))));
return webClient.exchange(HOST + API_GENERATE_TOKEN, HttpMethod.POST, JsonUtils.toJson(reqDTO), TokenResponse.class, map);
}
@ -138,15 +148,15 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
*/
@Override
@TraceLogging
public TokenResponse revokeToken(){
//validate(reqDTO, null);
public TokenRevokeResponse revokeToken(){
CrtfInfo niceDTO = getNiceCrtInfo();
return webClient.exchange(
HOST + API_GENERATE_TOKEN,
HttpMethod.POST,
null,
TokenResponse.class,
getHeaderMap(MediaType.APPLICATION_FORM_URLENCODED_VALUE, AUTH_TYPE_BASIC));
TokenRevokeResponse.class,
getHeaderMap(MediaType.APPLICATION_FORM_URLENCODED_VALUE, AUTH_TYPE_BASIC, niceDTO.getAccessToken()));
}
//--------------------------------------------------------------------------------
// 기관용 Token
@ -158,15 +168,27 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
@Override
@TraceLogging
public PublickeyResponse requestPublickey(final PublickeyRequest reqDTO) {
validate(reqDTO);
public PublickeyResponse requestPublickey() {
CrtfInfo niceDTO = getNiceCrtInfo();
final String todayDt = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss");
final PublickeyRequest pubReqDTO = PublickeyRequest.builder()
.dataHeader(RequestDataHeader.builder()
.cntyId(CNTY_CD)
.tranId(String.format("%s%s", TRAN_ID_PREFIX, todayDt))
.build())
.dataBody(PublickeyReqDataBody.builder()
.reqDtim(todayDt)
.build())
.build();
validate(pubReqDTO);
return webClient.exchange(
HOST + API_GENERATE_TOKEN,
HttpMethod.POST,
null,
PublickeyResponse.class,
getHeaderMap(MediaType.APPLICATION_JSON_VALUE, AUTH_TYPE_BEARER));
getHeaderMap(MediaType.APPLICATION_JSON_VALUE, AUTH_TYPE_BEARER, niceDTO.getAccessToken()));
}
//--------------------------------------------------------------------------------
@ -188,49 +210,91 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
* </pre>
*/
@Override
public SymmetrickeyRegResponse requestRegSymmetrickey(SymmetrickeyRegRequest reqDTO) {
public SymmetrickeyRegResponse requestRegSymmetrickey() {
//FIXME::NICE 연계이후 메소드 교체
//CrtfInfo niceDTO = getPublickeyCrtInfo();
CrtfInfo niceDTO = getNiceCrtInfo();
SymkeyRegInfo symkeyRegInfo = getSymkeyRegInfo(niceDTO);
//FIXME::NICE 연계이후 comment 제거
//String encSymkeyRegInfo = encodeString(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo));
String encSymkeyRegInfo = "encodeStringniceDTOgetPublicKeyJsonUtilstoJsonsymkeyRegInfo";
final String todayDt = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss");
SymmetrickeyRegRequest reqDTO = SymmetrickeyRegRequest.builder()
.dataHeader(RequestDataHeader.builder()
.cntyId(CNTY_CD)
.tranId(TRAN_ID_PREFIX + todayDt)
.build())
.dataBody(SymmetrickeyRegReqDataBody.builder()
.pubkeyVersion(niceDTO.getKeyVersion())
.symkeyRegInfo(encSymkeyRegInfo)
.build())
.build();
validate(reqDTO);
Map<String,String> headerMap = getHeaderMap(MediaType.APPLICATION_JSON_VALUE, AUTH_TYPE_BEARER, niceDTO.getAccessToken());
headerMap.put("ProductID", niceDTO.getProductId());
CrtfInfo crtfInfo = getNiceCrtInfo(reqDTO.getDataHeader());
return webClient.exchange(
HOST + API_SYMMETRICKEY,
HttpMethod.POST,
reqDTO,
SymmetrickeyRegResponse.class,
headerMap);
}
//--------------------------------------------------------------------------------
// 대칭키 : symmetrickey
//--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
/**
* Nice
* @return
*/
private CrtfInfo getNiceCrtInfo() {
CrtfInfo crtfInfo = cacheService.getNiceCrtfInfoCache(SIGNGU_CODE, FFNLG_CODE, CLIENT_ID);
if(ObjectUtils.isEmpty(crtfInfo)) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.crtfInfo"));
cacheService.logCache();
return null;
return crtfInfo;
}
/**
* <pre>
*
* 0. cache call
* --> 5
* 1. update
* 2. cache && cache call
* @param reqHeader RequestDataHeader
* -->
* 1.
* 2.
* 3. update
* 4. cache && cache reload
* @return
* </pre>
*/
private CrtfInfo getNiceCrtInfo(RequestDataHeader reqHeader) {
CrtfInfo crtfInfo = cacheService.getNiceCrtfInfoCache(SIGNGU_CODE, FFNLG_CODE, CLIENT_ID);
cacheService.logCache();
private CrtfInfo getPublickeyCrtInfo() {
CrtfInfo crtfInfo = getNiceCrtInfo();
if(crtfInfo.getRemainingDays() > EXPIRED_CHECK_DAYS) return crtfInfo;
//FIXME::공개키 발급요청 call
PublickeyRequest pubReqDTO = PublickeyRequest.builder()
.dataHeader(reqHeader)
.dataBody(PublickeyReqDataBody.builder()
.reqDtim(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"))
.build())
.build();
// 1. 토큰 폐기
TokenRevokeResponse revokeResDTO = revokeToken();
if(!(revokeResDTO.getDataHeader().getGwRsltCd().equals("1200") && revokeResDTO.getDataBody().isResult())){
throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.revoke.token"));
}
PublickeyResponse pubResDTO = requestPublickey(pubReqDTO);
//PublickeyResponse pubResDTO = JsonUtils.toObject(pubResJson, PublickeyResponse.class);
// 2. 공개키 발급 요청
PublickeyResponse pubResDTO = requestPublickey();
//FIXME::공개키 정보 갱신
//FIXME::공개키 정보 갱신 - Error code enum 전환
ResponseDataHeader dataHeader = pubResDTO.getDataHeader();
PublickeyResDataBody dataBody = pubResDTO.getDataBody();
// 3. 공개키 정보 update
if(dataHeader.getGwRsltCd().equals("1200")
&& dataBody.getRspCd().equals("P000")
&& dataBody.getResultCd().equals("0000")){
@ -244,16 +308,29 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
throw BizRuntimeException.create(JsonUtils.toJson(dataHeader));
}
// 4. cache 삭제 && cache reload
cacheService.removeNiceCrtfInfoCache(SIGNGU_CODE, FFNLG_CODE, CLIENT_ID);
return cacheService.getNiceCrtfInfoCache(SIGNGU_CODE, FFNLG_CODE, CLIENT_ID);
}
//--------------------------------------------------------------------------------
// 대칭키 : symmetrickey
//--------------------------------------------------------------------------------
/**
* <pre>
* (symmetrickey) symkey_reg_info JSON
* @param crtfInfo
* @return
* </pre>
*/
private SymkeyRegInfo getSymkeyRegInfo(CrtfInfo crtfInfo) {
return SymkeyRegInfo.builder()
.siteCode(crtfInfo.getSiteCode())
.requestNo(UUIDGenerateUtils.generateLengthUuid(30))
.key(UUIDGenerateUtils.generateLengthUuid(32))
.iv(UUIDGenerateUtils.generateLengthUuid(16))
.hmacKey(UUIDGenerateUtils.generateLengthUuid(32))
.build();
}
//-------------------------------------------------------------------------------
private Map<String,String> getHeaderMap(final String contentType, final String type){
private Map<String,String> getHeaderMap(final String contentType, final String type, final String accessToken){
Map<String,String> map = new HashMap<>();
if(ObjectUtils.isNotEmpty(contentType)) map.put(HttpHeaders.CONTENT_TYPE, contentType);
map.put(
@ -263,7 +340,7 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
Base64Utils.encodeToString(
Base64Utils.encode(
String.format("%s:%s:%s",
"accessToken",
accessToken,
(new Date().getTime() / 1000),
this.CLIENT_ID).getBytes(StandardCharsets.UTF_8))
)
@ -295,13 +372,12 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
* @param planText
* @return
*/
protected final String encodeString(final String strPublicKey, final String planText) { //throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
private String encodeString(final String strPublicKey, String planText) { //throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
byte[] cipherEnc = Base64.getDecoder().decode(strPublicKey);
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(cipherEnc);
java.security.PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
@ -317,16 +393,21 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
}
}
protected final String randomAlphaWord(int wordLength) {
Random r = new Random();
StringBuilder sb = new StringBuilder(wordLength);
for (int i = 0; i < wordLength; i++) {
char tmp = (char) ('a' + r.nextInt('z' - 'a'));
sb.append(tmp);
}
return sb.toString();
}
// private String encodeString2(final String strPublicKey, final String planText) { //throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
//
// try {
// PublicKey publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAJJxwIDAQAB";
// Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
// cipher.init(Cipher.ENCRYPT_MODE, publicKey);
// byte[] bytePlain = cipher.doFinal(planText.getBytes());
// return Base64Utils.encodeToString(bytePlain);
//
// } catch (NoSuchAlgorithmException|InvalidKeySpecException|NoSuchPaddingException|InvalidKeyException e){
// throw BizRuntimeException.create(e.getMessage());
// } catch (IllegalBlockSizeException e) {
// throw BizRuntimeException.create(e.getMessage());
// } catch (BadPaddingException e) {
// throw BizRuntimeException.create(e.getMessage());
// }
// }
}

@ -1,14 +1,10 @@
package kr.xit.ens.support.nice.web;
package kr.xit.ens.nice.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.nice.NiceCiDTO.PublickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRegRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRequest;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.ens.support.nice.service.INiceCiService;
import kr.xit.ens.nice.service.INiceCiService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
@ -20,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.nice.web
* packageName : kr.xit.ens.nice.web
* fileName : NiceCiController
* author : limju
* date : 2023-09-06
@ -34,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "NiceCiController", description = "Nice CI API")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/nice/v1")
@RequestMapping(value = "/api/ens/nice/v1")
public class NiceCiController {
private final INiceCiService service;
@ -70,9 +66,9 @@ public class NiceCiController {
@Operation(summary = "공개키 요청", description = "공개키 요청")
@PostMapping(value = "/requestPublickey", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestPublickey(
@RequestBody final PublickeyRequest reqDTO
//@RequestBody final PublickeyRequest reqDTO
) {
return ApiResponseDTO.success(service.requestPublickey(reqDTO));
return ApiResponseDTO.success(service.requestPublickey());
}
//--------------------------------------------------------------------------------
// 공개키(Publickey)
@ -84,9 +80,9 @@ public class NiceCiController {
@Operation(summary = "대칭키(symmetrickey) 등록 요청", description = "대칭키(symmetrickey) 등록 요청")
@PostMapping(value = "/requestRegSymmetrickey", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestRegSymmetrickey(
@RequestBody final SymmetrickeyRegRequest reqDTO
final String requestNo
) {
return ApiResponseDTO.success(service.requestRegSymmetrickey(reqDTO));
return ApiResponseDTO.success(service.requestRegSymmetrickey());
}
//--------------------------------------------------------------------------------

@ -1,27 +1,12 @@
package kr.xit.ens.support.nice.web;
package kr.xit.ens.nice.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 java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenResDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenResponse;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.support.nice.service.INiceCiService;
import kr.xit.ens.support.nice.service.NiceCiDummyTestService;
import kr.xit.ens.support.nice.service.NiceCiService;
import kr.xit.ens.nice.service.NiceCiDummyTestService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
@ -36,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
* <pre>
* description :
*
* packageName : kr.xit.ens.support.nice.web
* packageName : kr.xit.ens.nice.web
* fileName : NiceCiDummyTestController
* author : limju
* date : 2023-09-06
@ -51,7 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "NiceCiDummyTestController", description = "Nice CI Dummy Test")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/api/nice/test")
@RequestMapping(value = "/api/ens/nice/test")
public class NiceCiDummyTestController {
private final NiceCiDummyTestService service;
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
@ -97,9 +82,9 @@ public class NiceCiDummyTestController {
@Operation(summary = "공개키 요청", description = "공개키 요청")
@PostMapping(value = "/requestPublickey", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestPublickey(
@RequestBody final PublickeyRequest reqDTO
//@RequestBody final PublickeyRequest reqDTO
) {
return ApiResponseDTO.success(service.requestPublickey(reqDTO));
return ApiResponseDTO.success(service.requestPublickey());
}
//--------------------------------------------------------------------------------

@ -14,7 +14,6 @@ contract:
kakao:
bulk-max-cnt: 10
host: https://docs-gw.kakaopay.com
#host: https://dummy.restapiexample.com
token: dd394da7f66211eb9cbe46e139ceffc2
uuid: CON-41ef0535f67211ebbdedd2e6ed332381
api:
@ -25,7 +24,6 @@ contract:
bulksend: /v1/documents/bulk;POST
bulkstatus: /v1/documents/bulk/status;POST
nice:
#host: http://parking.cheonan.go.kr
host: https://svc.niceapi.co.kr:22001
signgu-code: 11000
ffnlg-code: 11

Loading…
Cancel
Save