From 03aa7ced90ee145177aaa9b60e407ea538f7a58f Mon Sep 17 00:00:00 2001 From: curry772 Date: Wed, 6 May 2026 16:49:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20CryptoModuleConfig=20JPA=20Entity=20?= =?UTF-8?q?=EB=B0=8F=20Loader=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CryptoModuleConfig: crypto_module_config 테이블 매핑 Entity - CryptoModuleConfigLoader: 설정 전체/단건 조회 인터페이스 - CryptoModuleConfigLoaderRepository: JPA Repository 구현체 Co-Authored-By: Claude Sonnet 4.6 --- .../loader/CryptoModuleConfigLoader.java | 13 +++ .../CryptoModuleConfigLoaderRepository.java | 13 +++ .../onl/security/CryptoModuleConfig.java | 105 ++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoader.java create mode 100644 src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoaderRepository.java create mode 100644 src/main/java/com/eactive/eai/data/entity/onl/security/CryptoModuleConfig.java diff --git a/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoader.java b/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoader.java new file mode 100644 index 0000000..2147e74 --- /dev/null +++ b/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoader.java @@ -0,0 +1,13 @@ +package com.eactive.eai.common.security.loader; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.eactive.eai.data.entity.onl.security.CryptoModuleConfig; +import com.eactive.eai.data.jpa.AbstractDataLoader; + +@Service +@Transactional +public class CryptoModuleConfigLoader + extends AbstractDataLoader { +} diff --git a/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoaderRepository.java b/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoaderRepository.java new file mode 100644 index 0000000..79c9d41 --- /dev/null +++ b/src/main/java/com/eactive/eai/common/security/loader/CryptoModuleConfigLoaderRepository.java @@ -0,0 +1,13 @@ +package com.eactive.eai.common.security.loader; + +import org.springframework.data.querydsl.QuerydslPredicateExecutor; + +import com.eactive.eai.data.DataLoaderRepository; +import com.eactive.eai.data.entity.onl.security.CryptoModuleConfig; +import com.eactive.eai.data.jpa.BaseRepository; + +interface CryptoModuleConfigLoaderRepository + extends DataLoaderRepository, + BaseRepository, + QuerydslPredicateExecutor { +} diff --git a/src/main/java/com/eactive/eai/data/entity/onl/security/CryptoModuleConfig.java b/src/main/java/com/eactive/eai/data/entity/onl/security/CryptoModuleConfig.java new file mode 100644 index 0000000..7c142dc --- /dev/null +++ b/src/main/java/com/eactive/eai/data/entity/onl/security/CryptoModuleConfig.java @@ -0,0 +1,105 @@ +package com.eactive.eai.data.entity.onl.security; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.Comment; +import org.hibernate.annotations.GenericGenerator; + +import com.eactive.eai.data.entity.AbstractEntity; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NonNull; + +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) + +@Entity +@Table(name = "crypto_module_config") +@org.hibernate.annotations.Table(appliesTo = "crypto_module_config", comment = "암호화모듈_설정") +public class CryptoModuleConfig extends AbstractEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "UUID") + @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") + @Column(name = "crypto_id", updatable = false, nullable = false, length = 36) + @Comment("암호화모듈 ID") + private String cryptoId; + + @Column(name = "crypto_name", unique = true, nullable = false, length = 100) + @Comment("암호화모듈 이름 (어댑터 참조 키)") + private String cryptoName; + + @Column(name = "crypto_desc", nullable = true, length = 500) + @Comment("암호화모듈 설명") + private String cryptoDesc; + + @Column(name = "alg_type", nullable = false, length = 10) + @Comment("알고리즘 유형 (AES, ARIA)") + private String algType; + + @Column(name = "cipher_mode", nullable = false, length = 20) + @Comment("운영 모드 (CBC, GCM, FF1, FF3-1)") + private String cipherMode; + + @Column(name = "padding", nullable = true, length = 30) + @Comment("패딩 방식 (PKCS5Padding, NoPadding)") + private String padding; + + @Column(name = "iv_hex", nullable = true, length = 200) + @Comment("초기화 벡터 Hex (선택)") + private String ivHex; + + @Column(name = "key_source_type", nullable = false, length = 20) + @Comment("키 소스 유형 (STATIC: DB 직접, DYNAMIC: 전략 기반 동적 생성)") + private String keySourceType; + + @Column(name = "enc_key_hex", nullable = true, length = 200) + @Comment("암호화 키 Hex (STATIC 전용)") + private String encKeyHex; + + @Column(name = "dec_key_hex", nullable = true, length = 200) + @Comment("복호화 키 Hex (STATIC 전용, 미입력 시 encKeyHex와 동일)") + private String decKeyHex; + + @Column(name = "key_deriv_strategy", nullable = true, length = 200) + @Comment("동적 키 도출 전략 코드 또는 FQCN (DYNAMIC 전용)") + private String keyDerivStrategy; + + @Column(name = "key_deriv_params", nullable = true, length = 2000) + @Comment("동적 키 도출 전략 파라미터 JSON (DYNAMIC 전용)") + private String keyDerivParams; + + @Column(name = "cache_yn", nullable = false, length = 1) + @Comment("동적 키 캐싱 사용 여부 (Y/N)") + private String cacheYn; + + @Column(name = "cache_ttl_sec", nullable = true) + @Comment("캐시 TTL 초 (기본 300)") + private Integer cacheTtlSec; + + @Column(name = "use_yn", nullable = false, length = 1) + @Comment("사용 여부 (Y/N)") + private String useYn; + + @Column(name = "modified_by", nullable = true, length = 50) + @Comment("수정자") + private String modifiedBy; + + @Column(name = "modified_at", nullable = true) + @Comment("수정일시") + private LocalDateTime modifiedAt; + + @Override + public @NonNull String getId() { + return this.cryptoId; + } +}