diff --git a/mens-api/src/main/java/kr/xit/ens/cmm/service/CmmEnsFileService.java b/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java similarity index 98% rename from mens-api/src/main/java/kr/xit/ens/cmm/service/CmmEnsFileService.java rename to mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java index 5d4eca6..fd96bef 100644 --- a/mens-api/src/main/java/kr/xit/ens/cmm/service/CmmEnsFileService.java +++ b/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java @@ -1,4 +1,4 @@ -package kr.xit.ens.cmm.service; +package kr.xit.biz.cmm.service; import java.io.IOException; import java.io.InputStream; @@ -29,7 +29,7 @@ import org.springframework.web.multipart.MultipartFile; *
* description : * - * packageName : kr.xit.ens.cmm.service + * packageName : kr.xit.biz.cmm.service * fileName : CmmEnsFileService * author : limju * date : 2023-09-05 diff --git a/mens-api/src/main/java/kr/xit/ens/cmm/service/ICmmEnsFileService.java b/mens-api/src/main/java/kr/xit/biz/cmm/service/ICmmEnsFileService.java similarity index 88% rename from mens-api/src/main/java/kr/xit/ens/cmm/service/ICmmEnsFileService.java rename to mens-api/src/main/java/kr/xit/biz/cmm/service/ICmmEnsFileService.java index 3ca18be..6d832af 100644 --- a/mens-api/src/main/java/kr/xit/ens/cmm/service/ICmmEnsFileService.java +++ b/mens-api/src/main/java/kr/xit/biz/cmm/service/ICmmEnsFileService.java @@ -1,4 +1,4 @@ -package kr.xit.ens.cmm.service; +package kr.xit.biz.cmm.service; import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload; @@ -6,7 +6,7 @@ import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload; ** description : * - * packageName : kr.xit.ens.cmm.service + * packageName : kr.xit.biz.cmm.service * fileName : ICmmEnsFileService * author : limju * date : 2023-09-05 diff --git a/mens-api/src/main/java/kr/xit/ens/cmm/web/CmmEnsFileController.java b/mens-api/src/main/java/kr/xit/biz/cmm/web/CmmEnsFileController.java similarity index 92% rename from mens-api/src/main/java/kr/xit/ens/cmm/web/CmmEnsFileController.java rename to mens-api/src/main/java/kr/xit/biz/cmm/web/CmmEnsFileController.java index c20e6ba..f3dad3e 100644 --- a/mens-api/src/main/java/kr/xit/ens/cmm/web/CmmEnsFileController.java +++ b/mens-api/src/main/java/kr/xit/biz/cmm/web/CmmEnsFileController.java @@ -1,10 +1,10 @@ -package kr.xit.ens.cmm.web; +package kr.xit.biz.cmm.web; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import kr.xit.biz.cmm.service.ICmmEnsFileService; import kr.xit.biz.ens.model.cmm.CmmEnsFileDTO.FmcExcelUpload; import kr.xit.core.model.ApiResponseDTO; -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; ** description : 전자고지 연계 파일 관련 처리 * - * packageName : kr.xit.ens.cmm.web + * packageName : kr.xit.biz.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/ens/cmm") +@RequestMapping(value = "/api/biz/cmm") public class CmmEnsFileController { private final ICmmEnsFileService service; diff --git a/mens-api/src/main/java/kr/xit/core/spring/config/SpringDocsApiConfig.java b/mens-api/src/main/java/kr/xit/core/spring/config/SpringDocsApiConfig.java index 30fefad..dea7f5d 100644 --- a/mens-api/src/main/java/kr/xit/core/spring/config/SpringDocsApiConfig.java +++ b/mens-api/src/main/java/kr/xit/core/spring/config/SpringDocsApiConfig.java @@ -37,19 +37,9 @@ public class SpringDocsApiConfig { @Bean public GroupedOpenApi kakaopayEltrcDoc() { return GroupedOpenApi.builder() - .group("2. 카카오페이 MyDoc API") + .group("2. 문서중계자 API") .pathsToMatch( - "/api/kakaopay/**" - ) - .build(); - } - - @Bean - public GroupedOpenApi niceCi() { - return GroupedOpenApi.builder() - .group("3. Nice CI API") - .pathsToMatch( - "/api/nice/**" + "/api/ens/**" ) .build(); } @@ -57,9 +47,9 @@ public class SpringDocsApiConfig { @Bean public GroupedOpenApi bizDoc() { return GroupedOpenApi.builder() - .group("6. 전자고지 문서 확인 API") + .group("6. 전자고지 업무 API") .pathsToMatch( - "/api/ens/**" + "/api/biz/**" ) .build(); } diff --git a/mens-core/src/main/java/kr/xit/biz/ens/model/nice/NiceCiDTO.java b/mens-core/src/main/java/kr/xit/biz/ens/model/nice/NiceCiDTO.java index 31ad5b2..5f93364 100644 --- a/mens-core/src/main/java/kr/xit/biz/ens/model/nice/NiceCiDTO.java +++ b/mens-core/src/main/java/kr/xit/biz/ens/model/nice/NiceCiDTO.java @@ -483,6 +483,60 @@ public class NiceCiDTO { @Schema(requiredMode = RequiredMode.AUTO, title = "사이트 코드", example = " ") private String symkeyStatInfo; } + + @Schema(name = "SymkeyRegInfo", description = "대칭키(symmetrickey) 등록 요청시 symkey_reg_info JSON 속성") + @Data + @NoArgsConstructor + @AllArgsConstructor + @SuperBuilder + @JsonInclude(Include.NON_NULL) + @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) + public static class SymkeyRegInfo { + @Schema(requiredMode = RequiredMode.REQUIRED, title = "사이트 코드", description = "공개키요청시 수신한 사이트코드", example = "AAA==") + @Size(min = 1, max = 16, message = "사이트 코드는 필수 입니다(max:16)") + private String siteCode; + + @Schema(requiredMode = RequiredMode.REQUIRED, title = "요청고유번호", description = "이용기관에서 생성한 임의의 값", example = " ") + @Size(min = 30, max = 30, message = "요청고유번호는 필수 입니다(max:30)") + private String requestNo; + + @Schema(requiredMode = RequiredMode.REQUIRED, title = "암호화키", description = "사용할 암호화키", example = " ") + @Size(min = 32, max = 32, message = "사이트 코드는 필수 입니다(max:32)") + private String key; + + @Schema(requiredMode = RequiredMode.REQUIRED, title = "iv", description = "inital Vector", example = " ") + @Size(min = 16, max = 16, message = "iv는 필수 입니다(max:16)") + private String iv; + + @Schema(requiredMode = RequiredMode.REQUIRED, title = "hmac_key", description = "사용할 HMAC KEY", example = " ") + @Size(min = 32, max = 32, message = "iv는 필수 입니다(max:16)") + private String hmacKey; + } + + @Schema(name = "SymkeyStatInfo", description = "대칭키(symmetrickey) 등록 결과 symkey_stat_info JSON 속성") + @Data + @NoArgsConstructor + @AllArgsConstructor + @SuperBuilder + @JsonInclude(Include.NON_NULL) + @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) + public static class SymkeyStatInfo { + @Schema(requiredMode = RequiredMode.AUTO, title = "cur_symkey_version", description = "현재 등록 요청한 대칭키 버전", example = " ") + @Size(max = 50) + private String curSymkeyVersion; + + @Schema(requiredMode = RequiredMode.AUTO, title = "cur_valid_dtim", description = "현재 등록된 대칭키 만료일시 (YYYYMMDDHH24MISS)", example = " ") + @Size(max = 14) + private String curValidDtim; + + @Schema(requiredMode = RequiredMode.AUTO, title = "bef_symkey_version", description = "이전 등록된 대칭키 버전", example = " ") + @Size(max = 50) + private String befSymkeyVersion; + + @Schema(requiredMode = RequiredMode.AUTO, title = "bef_valid_dtim", description = "이전 등록된 대칭키 만료일시 (YYYYMMDDHH24MISS)", example = " ") + @Size(max = 14) + private String befvaliddtim; + } //-------------------------------------------------------------------------------- // 대칭키 : symmetrickey //-------------------------------------------------------------------------------- @@ -658,7 +712,46 @@ public class NiceCiDTO { * 공개키 만료일시 */ private String validDtim; - + /** + * 현재 대칭키 버전 + */ + private String curSymkeyVersion; + /** + * 현재 대칭키 만료일시 + */ + private String curSymkeyValidDtim; + /** + * 현재 대칭키 key + */ + private String curSymkeyKey; + /** + * 현재 대칭키 iv + */ + private String curSymkeyiv; + /** + * 현재 대칭키 hmac_key + */ + private String curSymkeyHmacKey; + /** + * 이전 대칭키 버전 + */ + private String befSymkeyVersion; + /** + * 이전 대칭키 만료일시 + */ + private String befSymkeyValidDtim; + /** + * 이전 대칭키 key + */ + private String befSymkeyKey; + /** + * 이전 대칭키 iv + */ + private String befSymkeyIv; + /** + * 이전 대칭키 hmac_key + */ + private String befSymkeyHmacKey; /** * 공개키 잔여일수 diff --git a/mens-core/src/main/java/kr/xit/core/support/utils/UUIDGenerateUtils.java b/mens-core/src/main/java/kr/xit/core/support/utils/UUIDGenerateUtils.java new file mode 100644 index 0000000..22b0553 --- /dev/null +++ b/mens-core/src/main/java/kr/xit/core/support/utils/UUIDGenerateUtils.java @@ -0,0 +1,31 @@ +package kr.xit.core.support.utils; + +import java.nio.ByteBuffer; +import java.util.Random; +import java.util.UUID; + +public class UUIDGenerateUtils { + + public static String generateLengthUuid(int length) { + String allChars = UUID.randomUUID().toString().replace("-", ""); + Random random = new Random(); + char[] otp = new char[length]; + for (int i = 0; i < length; i++) { + otp[i] = allChars.charAt(random.nextInt(allChars.length())); + } + return String.valueOf(otp); + } + + public static String generateLengthUuid2(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(); + + } +}