Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough프로젝트 버전이 Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java (1)
29-40:⚠️ Potential issue | 🟡 Minor
deletedBy파라미터에 대한 null 체크 누락이전 구현에서는
StringUtils기반의 빈 값 처리와SYSTEM기본값 로직이 있었습니다. 현재 구현에서는deletedBy가null로 전달될 경우 감사 필드가null로 설정됩니다.🛡️ null 체크 추가 제안
protected void delete(UUID deletedBy) { // 중복 삭제로 인해 삭제 관련 필드가 업데이트되는 상황을 방지 if (isDeleted()) { return; } + if (deletedBy == null) { + throw new IllegalArgumentException("deletedBy cannot be null"); + } this.updatedBy = deletedBy; this.deletedBy = deletedBy; this.updatedAt = LocalDateTime.now(); this.deletedAt = LocalDateTime.now(); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java` around lines 29 - 40, delete(UUID deletedBy) 메서드에서 deletedBy가 null일 경우 감사 필드가 null로 설정되는 문제가 있으니 null 검사 및 기본값 할당 로직을 추가하세요: BaseUserEntity 클래스에 존재하는 SYSTEM 상수(또는 기존 프로젝트의 시스템 유저 식별자)를 사용해 deletedBy가 null이면 SYSTEM으로 대체한 후 this.updatedBy/this.deletedBy에 할당하도록 수정하고, 기존 isDeleted() 체크와 시간 업데이트 로직은 그대로 유지하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java`:
- Around line 19-26: Add JPA auditing configuration so
`@CreatedBy/`@LastModifiedBy populate createdBy/updatedBy: create a configuration
class named JpaAuditingConfig annotated with `@Configuration` and
`@EnableJpaAuditing` that declares a Bean auditorProvider returning an
AuditorAware<UUID> (e.g., using a getCurrentUserUUID() helper that reads the
current principal from SecurityContext); ensure this bean name and type are
available so the JPA auditing infrastructure can inject auditors for the
createdBy and updatedBy fields.
- Around line 46-57: Add null checks for the UUID parameters in both
delete(UUID) and restore(UUID): validate that the incoming restoredBy/deletedBy
is not null and throw an appropriate unchecked exception (e.g.,
IllegalArgumentException or NullPointerException) with a clear message when null
is passed; update BaseUserEntity.restore(UUID restoredBy) to perform the same
null validation as BaseUserEntity.delete(UUID deletedBy) before mutating
updatedBy/deletedBy/updatedAt/deletedAt. Also make the method access modifiers
consistent—either change restore to protected to match delete or change delete
to public—so both methods use the same visibility (follow existing design and
prefer making restore protected if delete is protected).
---
Outside diff comments:
In `@src/main/java/com/fhsh/daitda/domain/BaseUserEntity.java`:
- Around line 29-40: delete(UUID deletedBy) 메서드에서 deletedBy가 null일 경우 감사 필드가
null로 설정되는 문제가 있으니 null 검사 및 기본값 할당 로직을 추가하세요: BaseUserEntity 클래스에 존재하는 SYSTEM
상수(또는 기존 프로젝트의 시스템 유저 식별자)를 사용해 deletedBy가 null이면 SYSTEM으로 대체한 후
this.updatedBy/this.deletedBy에 할당하도록 수정하고, 기존 isDeleted() 체크와 시간 업데이트 로직은 그대로
유지하세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 772b48ab-9729-40db-b030-ddb1a610465d
📒 Files selected for processing (2)
build.gradlesrc/main/java/com/fhsh/daitda/domain/BaseUserEntity.java
🌱 설명
감사 필드의 생성자, 수정자, 삭제자를 UUID로 변경
📌 관련 이슈
✅ 주요 변경 사항
📝 체크리스트
📚 추가 설명
Summary by CodeRabbit
릴리스 노트
Chores
Bug Fixes