From 75ce72f372edbabcbf699ccd0bb97acfbd4fc92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-NQ67GLI5=5C=EA=B9=80=EB=8B=A4=EC=9D=80?= Date: Sun, 5 Apr 2026 20:39:38 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20Audit=20=EC=83=9D=EC=84=B1=EC=9E=90,?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=EC=9E=90,=20=EC=82=AD=EC=A0=9C=EC=9E=90?= =?UTF-8?q?=20=ED=95=84=EB=93=9C=20UUID=20=ED=95=84=EB=93=9C=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fhsh/daitda/domain/BaseUserEntity.java | 38 ++++++------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java b/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java index 972a733..0e1b7fa 100644 --- a/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java +++ b/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java @@ -7,40 +7,33 @@ import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import org.springframework.util.StringUtils; import java.time.LocalDateTime; +import java.util.UUID; @Getter @MappedSuperclass @EntityListeners(AuditingEntityListener.class) public abstract class BaseUserEntity extends BaseEntity { - private static final int AUDITOR_MAX_LENGTH = 45; - @CreatedBy - @Column(length = AUDITOR_MAX_LENGTH, updatable = false) - protected String createdBy; + @Column(updatable = false) + protected UUID createdBy; @LastModifiedBy - @Column(length = AUDITOR_MAX_LENGTH) - protected String updatedBy; + protected UUID updatedBy; - @Column(length = AUDITOR_MAX_LENGTH) - protected String deletedBy; + protected UUID deletedBy; // Soft Delete 구현 - protected void delete(String deletedBy) { + protected void delete(UUID deletedBy) { // 중복 삭제로 인해 삭제 관련 필드가 업데이트되는 상황을 방지 if (isDeleted()) { return; } - - validateAuditorLength(deletedBy); - - // 삭제자가 없으면 SYSTEM 삭제로 간주 - this.updatedBy = StringUtils.hasText(deletedBy) ? deletedBy : "SYSTEM"; - this.deletedBy = StringUtils.hasText(deletedBy) ? deletedBy : "SYSTEM"; + + this.updatedBy = deletedBy; + this.deletedBy = deletedBy; this.updatedAt = LocalDateTime.now(); this.deletedAt = LocalDateTime.now(); @@ -50,23 +43,16 @@ public boolean isDeleted() { return this.deletedAt != null; } - public void restore(String restoredBy) { + // 삭제 복구 + public void restore(UUID restoredBy) { if (!isDeleted()) { return; } - validateAuditorLength(restoredBy); - - this.updatedBy = StringUtils.hasText(restoredBy) ? restoredBy : "SYSTEM"; + this.updatedBy = restoredBy; this.deletedBy = null; this.updatedAt = LocalDateTime.now(); this.deletedAt = null; } - - private void validateAuditorLength(String auditor) { - if (auditor != null && auditor.length() > AUDITOR_MAX_LENGTH) { - throw new IllegalArgumentException("auditor 정보는 %d자를 초과할 수 없습니다.".formatted(AUDITOR_MAX_LENGTH)); - } - } } From a39074c6bb18e0b6f009b8e09f81ffdeae8b2970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-NQ67GLI5=5C=EA=B9=80=EB=8B=A4=EC=9D=80?= Date: Sun, 5 Apr 2026 20:43:17 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Chore:=200.1.4-SNAPSHOT=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EB=B2=84=EC=A0=84=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9d06bd3..855551a 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'com.fhsh.daitda' -version = '0.1.3-SNAPSHOT' +version = '0.1.4-SNAPSHOT' java { toolchain { From de9f1ebb74a910968f0b264c10d4ca1ae60b8af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-NQ67GLI5=5C=EA=B9=80=EB=8B=A4=EC=9D=80?= Date: Sun, 5 Apr 2026 21:02:38 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Chore:=20delete()=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20public=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java b/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java index 0e1b7fa..3851685 100644 --- a/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java +++ b/src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java @@ -26,7 +26,7 @@ public abstract class BaseUserEntity extends BaseEntity { protected UUID deletedBy; // Soft Delete 구현 - protected void delete(UUID deletedBy) { + public void delete(UUID deletedBy) { // 중복 삭제로 인해 삭제 관련 필드가 업데이트되는 상황을 방지 if (isDeleted()) { return;