Skip to content

Conversation

@Hajin99
Copy link
Member

@Hajin99 Hajin99 commented Nov 30, 2025

#️⃣연관된 이슈

#202

📝작업 내용

마이페이지 수정

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
x

Summary by CodeRabbit

변경사항

  • 개선 사항
    • 사용자 프로필에서 AI 아티클 정보 표시 방식 최적화

✏️ Tip: You can customize this high-level summary in your review settings.

@Hajin99 Hajin99 linked an issue Nov 30, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Walkthrough

이 변경사항은 UsersLinku 엔티티의 AI 존재 여부 필드를 isAiExist에서 aiExist로 이름을 변경하고, 관련 Getter/Setter를 업데이트하며, 데이터 타입을 Long(카운트)에서 Boolean(존재 여부)으로 변환합니다. 저장소 쿼리, 서비스 계층, DTO 전체에 걸쳐 해당 참조를 일관되게 업데이트합니다.

Changes

Cohort / File(s) Change Summary
엔티티 및 필드 이름 변경
src/main/java/com/umc/linkyou/domain/mapping/UsersLinku.java
필드 isAiExist를 aiExist로 이름 변경, 매핑 어노테이션 유지, 명시적 Getter 메서드 추가
저장소 계층 업데이트
src/main/java/com/umc/linkyou/repository/userRepository/UserQueryRepository.java
aiLinkCountSub 주석 제거, BooleanExpression 임포트 추가, exists() 사용하는 aiExistSub 서브쿼리로 교체, UserProfileSummaryDto 프로젝션 업데이트
서비스 계층 Getter/Setter 업데이트
src/main/java/com/umc/linkyou/service/AiArticleServiceImpl.java,
src/main/java/com/umc/linkyou/service/Linku/LinkuRecommendServiceImpl.java,
src/main/java/com/umc/linkyou/service/Linku/LinkuServiceImpl.java
getIsAiExist()를 getAiExist()로, setIsAiExist()를 setAiExist()로 업데이트 (총 5개 사용처)
DTO 필드 타입 변경
src/main/java/com/umc/linkyou/web/dto/UserResponseDTO.java
UserInfoDTO 및 UserProfileSummaryDto의 myAiLinku 필드를 Long에서 Boolean으로 변경, 생성자 매개변수 및 할당 로직 업데이트
빌드 설정 주석 변경
build.gradle
주석 처리된 MySQL 커넥터 의존성을 runtimeOnly에서 implementation으로 변경 (기능적 변화 없음)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 주의 사항:
    • UserResponseDTO.java: Long에서 Boolean으로의 필드 타입 변경이 클라이언트 API 응답 계약에 미치는 영향 검증 필요
    • UserQueryRepository.java: Querydsl exists() 서브쿼리 로직이 SQL 생성을 올바르게 수행하는지, 성능에 문제가 없는지 확인
    • 다중 서비스 파일: 다양한 서비스 계층에 걸쳐 동일한 이름 변경이 적용되었으므로 변경 일관성 확인

Possibly related PRs

  • Feat/#184 ai article exist #185: 동일한 UsersLinku AI 존재 여부 기능을 수정하며, 이전 PR에서 isAiExist 필드와 로직을 도입했고 현재 PR에서 isAiExist → aiExist로 이름 변경하고 Getter/Setter, 저장소 서브쿼리, 서비스 체크 및 DTO 업데이트
  • Feat/#29 domain convenient api #153: AI 아티클 존재 여부 boolean을 코드베이스 전체에 구현 및 전파 (현재 PR에서는 엔티티/Getter 이름 변경 및 Querydsl exists 서브쿼리, DTO 필드/타입 변경)
  • Feat/#35 ai article #132: AiArticleServiceImpl을 수정하는 PR들로, AI 존재 여부 접근자 이름 업데이트 관련

Suggested reviewers

  • HyeonJooooo
  • hyorim-jo

Poem

🐰 필드를 다시 지었네, 이름도 참 좋고,

Boolean의 품으로 담았으니 카운트는 물렀고,

저장소부터 서비스까지 모두 춤을 춘다네,

존재만 묻는 단순한 마음, 참 아름답도다! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 'feat: ai article 여부'로 변경 사항의 핵심을 정확히 반영하고 있습니다. 이 PR은 AI 아티클 존재 여부를 나타내는 필드를 refactor한 작업이며, 제목이 이를 명확하게 표현합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#202-ai-exist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Hajin99 Hajin99 self-assigned this Nov 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
build.gradle (1)

31-31: 불필요한 변경 사항으로 보입니다.

주석 처리된 의존성 라인의 설정을 변경하는 것이 이번 PR의 목적(AI 존재 여부 필드 리팩토링)과 관련이 없어 보입니다. 의도적인 변경이 아니라면 되돌려 주세요.

src/main/java/com/umc/linkyou/web/dto/UserResponseDTO.java (1)

61-61: Boolean 필드 네이밍 컨벤션을 고려해 주세요.

myAiLinku 필드의 타입이 Long에서 Boolean로 변경되었습니다. Boolean 필드는 일반적으로 isXxx 또는 hasXxx 형태로 명명합니다. myAiLinku 대신 hasAiLinku 또는 isAiLinkuExist 같은 이름을 고려해 주세요.

Also applies to: 86-86

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88b8c4f and f9c99a2.

📒 Files selected for processing (7)
  • build.gradle (1 hunks)
  • src/main/java/com/umc/linkyou/domain/mapping/UsersLinku.java (1 hunks)
  • src/main/java/com/umc/linkyou/repository/userRepository/UserQueryRepository.java (3 hunks)
  • src/main/java/com/umc/linkyou/service/AiArticleServiceImpl.java (2 hunks)
  • src/main/java/com/umc/linkyou/service/Linku/LinkuRecommendServiceImpl.java (1 hunks)
  • src/main/java/com/umc/linkyou/service/Linku/LinkuServiceImpl.java (2 hunks)
  • src/main/java/com/umc/linkyou/web/dto/UserResponseDTO.java (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (5)
src/main/java/com/umc/linkyou/service/Linku/LinkuRecommendServiceImpl.java (1)

168-168: LGTM!

getAiExist() 메서드로 올바르게 업데이트되었으며, Boolean.TRUE.equals()를 사용하여 null 안전성도 확보되었습니다.

src/main/java/com/umc/linkyou/service/Linku/LinkuServiceImpl.java (1)

110-110: LGTM!

getAiExist() 메서드로 올바르게 업데이트되었으며, Boolean.TRUE.equals()를 사용하여 null 안전성이 확보되어 있습니다.

Also applies to: 182-182

src/main/java/com/umc/linkyou/service/AiArticleServiceImpl.java (1)

133-133: LGTM!

setAiExist()getAiExist() 메서드로 올바르게 업데이트되었으며, Line 182에서는 null 체크도 적절히 수행되고 있습니다.

Also applies to: 182-182

src/main/java/com/umc/linkyou/web/dto/UserResponseDTO.java (1)

97-105: API 호환성 변경사항을 확인해 주세요.

myAiLinku 필드의 타입이 Long(개수)에서 Boolean(존재 여부)로 변경되었습니다. 이는 API 스펙의 변경이므로 다음을 확인해 주세요:

  1. 프론트엔드 또는 API 소비자가 이 필드를 숫자로 기대하는 경우 대응이 필요합니다.
  2. API 문서(Swagger 등)가 업데이트되었는지 확인해 주세요.
  3. 버전 관리가 필요한지 검토해 주세요.
src/main/java/com/umc/linkyou/repository/userRepository/UserQueryRepository.java (1)

50-56: Semantic change: flag-based check replaces join-based query—document maintenance contract.

The query now checks UsersLinku.aiExist flag instead of joining to ai_article table. Since AI article deletion is not implemented in the codebase, the flag won't fall out of sync currently. However, this denormalization introduces a maintenance contract: setAiExist(true) is set in AiArticleServiceImpl.java:133 during article creation, but there is no corresponding reset to false on deletion. If article deletion is added in the future without updating this flag, the query will return incorrect results.

Consider either: (1) adding explicit comment documenting that aiExist must be maintained if deletion is implemented, or (2) switching back to the join-based query if consistency is critical for user profile display.

Comment on lines +43 to +47
private Boolean aiExist = false;

public Boolean getAiExist() {
return this.aiExist;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "UsersLinku.java" -path "*/domain/mapping/*"

Repository: LinkYou-2025/LinkU_backend

Length of output: 132


🏁 Script executed:

cat -n ./src/main/java/com/umc/linkyou/domain/mapping/UsersLinku.java | head -60

Repository: LinkYou-2025/LinkU_backend

Length of output: 1617


🌐 Web query:

Lombok @Getter boolean field naming convention isXxx getXxx

💡 Result:

Short answer: Lombok follows JavaBean rules — for primitive boolean fields it generates isXxx(); for Boolean it generates getXxx(); and if the field name already starts with "is" followed by an uppercase letter Lombok will not prefix another "is" (it will generate a method matching the field name). Lombok also avoids generating duplicate accessors when names conflict. (projectlombok.org)

Citations:


🌐 Web query:

Lombok duplicate method error explicit getter @Getter conflict

💡 Result:

Cause

  • Lombok generates methods (getters/constructors/delegates). A "duplicate method" error appears when Lombok would generate a method that already exists (you wrote it, it exists in a superclass, or another Lombok annotation also generates it). Examples: @Getter on a field named like a superclass method (getModel), combining @NoArgsConstructor/@AllArgsConstructor/@requiredargsconstructor that both produce a no-arg constructor, or @DeleGate copying the same method twice. [1][2][3]

How to fix (pick the one that fits)

  • Remove the explicit method (let Lombok generate it) or remove the Lombok annotation (keep your explicit method). [2]
  • Suppress Lombok generation for a specific field: annotate the field with @Getter(AccessLevel.NONE) (or use @Setter(AccessLevel.NONE)) so Lombok won't generate that accessor. Or put @Getter on the class but @Getter(AccessLevel.NONE) on the specific field. [1]
  • Rename the field so the generated accessor name doesn't clash with a superclass method. [3]
  • For constructor conflicts: avoid combining annotations that produce identical constructors (write the constructor yourself, or use @SuperBuilder for inheritance-aware constructors). Use @NoArgsConstructor(force=true) only if appropriate. [2]
  • For @DeleGate conflicts: use @DeleGate(excludes=...) or delegate to a narrower interface to avoid copying duplicate methods. [1][4]
  • If your IDE shows the error but javac/build succeeds, ensure annotation processing is enabled and the Lombok IDE plugin is installed; sometimes IDE tooling reports false duplicates. [2]

References

  • Lombok @DeleGate docs — explains delegation and excludes. [1]
  • StackOverflow threads on duplicate constructors and Lombok-generated methods. [2]
  • Example of getter name clash with superclass (rename/suppress solution). [3]
  • VSCode/@DeleGate duplicate-method discussion. [4]

Remove duplicate getter or suppress Lombok generation for aiExist field.

The explicit getAiExist() method on lines 45-47 duplicates the getter that Lombok's @Getter annotation (line 11) generates. For Boolean wrapper type fields, Lombok generates getXxx() methods, not isXxx().

To resolve: either remove the explicit getAiExist() method and let Lombok generate it, or annotate the field with @Getter(AccessLevel.NONE) to suppress Lombok generation for this field.

Note: The field naming aiExist with getter getAiExist() follows valid Java conventions for boolean properties; the database column name is_ai_exist is also appropriate.

🤖 Prompt for AI Agents
In src/main/java/com/umc/linkyou/domain/mapping/UsersLinku.java around lines 43
to 47, there is a duplicate getter for the Boolean field aiExist that conflicts
with Lombok's @Getter on the class; remove the explicit getAiExist() method so
Lombok generates it, OR suppress Lombok for this field by adding
@Getter(AccessLevel.NONE) to the aiExist field and keep the custom getAiExist()
implementation; if you choose suppression, add the lombok.AccessLevel import and
ensure only one getter exists after the change.

@Hajin99 Hajin99 merged commit 2aead61 into develop Nov 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: 마이페이지에 요약 사용 여부

2 participants