Skip to content

Conversation

@minjee2758
Copy link
Collaborator

@minjee2758 minjee2758 commented Jul 4, 2025

작업 내용

  • userDomainService 테스트코드 추가
  • AI코드리뷰 토큰 조회 추가
  • 날짜별 문제 맞춘 개수 조회 추가(/api/users/daily-solved)

참고 사항

  • 기타 공유하고 싶은 정보나 참고한 문서(링크 등)가 있다면 작성해주세요.

코드 리뷰 전 확인 체크리스트

  • 불필요한 콘솔 로그, 주석 제거
  • 커밋 메시지 컨벤션 준수 (type : )
  • 기능 정상 동작 확인

Summary by CodeRabbit

  • 신규 기능

    • 로그인한 사용자의 남은 AI 리뷰 토큰 조회 API가 추가되었습니다.
    • 로그인한 사용자의 일별 문제 풀이 내역을 조회할 수 있는 API가 추가되었습니다.
    • 사용자 일별 정답 횟수를 보여주는 기능이 도입되었습니다.
    • 실행 시간 표시 단위가 초에서 밀리초로 변경되었습니다.
  • 테스트

    • 닉네임 생성에 대한 단위 테스트가 추가되었습니다.
    • 불필요한 테스트 메서드가 정리되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Jul 4, 2025

"""

Walkthrough

새로운 DTO 클래스 UserReviewTokenResponseUserDailySolvedHistoryResponse가 추가되었고, 사용자의 리뷰 토큰 및 일별 문제 해결 기록을 조회하는 서비스 메서드와 API 엔드포인트가 각각 UserServiceUserController에 도입되었습니다. 문제 제출 결과를 일별로 집계하는 쿼리 및 관련 저장소 인터페이스와 구현체도 추가되었습니다. 또한, 사용자 도메인 서비스 관련 테스트가 확장되어 닉네임 생성, 리뷰 토큰 감소에 대한 단위 테스트가 추가되었습니다. OpenAI API 호출 타임아웃이 10초에서 20초로 연장되었고, 실행 시간 단위 표시가 ms로 수정되었습니다.

Changes

파일/경로 요약 변경 내용 요약
.../usermanagement/user/dto/response/UserReviewTokenResponse.java 리뷰 토큰 정보를 담는 불변 DTO 클래스 신설 (reviewToken 필드, Lombok 활용)
.../usermanagement/user/dto/response/UserDailySolvedHistoryResponse.java 사용자 일별 문제 해결 기록을 담는 DTO 레코드 신설 (userId, List<DailyCorrectCount>)
.../domain/submission/dto/DailyCorrectCount.java 날짜별 정답 개수를 담는 레코드 추가, java.sql.Date 변환 생성자 포함
.../domain/submission/repository/UserProblemResultRepository.java 사용자별 정답 개수를 날짜별로 집계하는 메서드 시그니처 추가
.../domain/submission/service/SubmissionDomainService.java 사용자별 일별 문제 해결 기록 조회 메서드 추가 (getSolvedHistoryByDate)
.../infrastructure/persistence/repository/submission/impl/UserProblemResultRepositoryImpl.java UserProblemResultQueryRepository 의존성 추가 및 날짜별 정답 개수 집계 메서드 구현 추가
.../infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepository.java 사용자별 정답 개수를 날짜별로 집계하는 쿼리 인터페이스 추가
.../infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java QueryDSL 기반으로 사용자별 날짜별 정답 개수 집계 쿼리 구현 클래스 추가
.../application/usermanagement/user/service/UserService.java getReviewToken(AuthUser), getUserDailySolvedHistory(AuthUser) 메서드 추가 및 관련 DTO import 추가
.../presentation/usermanagement/UserController.java /api/users/review-token, /api/users/daily-solved GET 엔드포인트 추가 및 서비스 메서드 위임, DTO import 추가
.../domain/user/UserDomainServiceTest.java 닉네임 생성, 리뷰 토큰 감소 단위 테스트 추가, 일부 테스트 주석 처리 및 불필요 메서드/임포트 제거
.../infrastructure/openai/OpenAIReviewClient.java OpenAI API 호출 타임아웃 10초에서 20초로 연장
.../resources/templates/submit-test.html 테스트 실행 시간 단위 표시를 "s"에서 "ms"로 수정

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant UserController
    participant UserService
    participant SubmissionDomainService
    participant UserDomainService
    participant UserProblemResultRepository

    Client->>UserController: GET /api/users/review-token (AuthUser)
    UserController->>UserService: getReviewToken(AuthUser)
    UserService->>UserDomainService: getUserById(authUser.getId())
    UserDomainService-->>UserService: User
    UserService-->>UserController: UserReviewTokenResponse
    UserController-->>Client: ResponseEntity<UserReviewTokenResponse>

    Client->>UserController: GET /api/users/daily-solved (AuthUser)
    UserController->>UserService: getUserDailySolvedHistory(AuthUser)
    UserService->>SubmissionDomainService: getSolvedHistoryByDate(authUser.getId())
    SubmissionDomainService->>UserProblemResultRepository: countCorrectByUserGroupedByDate(userId)
    UserProblemResultRepository-->>SubmissionDomainService: List<DailyCorrectCount>
    SubmissionDomainService-->>UserService: UserDailySolvedHistoryResponse
    UserService-->>UserController: UserDailySolvedHistoryResponse
    UserController-->>Client: ResponseEntity<UserDailySolvedHistoryResponse>
Loading

Suggested labels

Test, enhancement

Suggested reviewers

  • NCookies
  • Kimminu7
  • pokerbearkr
  • chat26666

Poem

🐇
토큰과 기록 새로 담아,
컨트롤러에 길을 열었네.
테스트로 다져진 닉네임,
API도 한층 단단해져.
타임아웃 늘리고 단위 고쳐,
토끼가 춤추는 코드 숲!
🥕✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 978e511 and 6e5d751.

📒 Files selected for processing (1)
  • src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c02508 and 65a132f.

📒 Files selected for processing (4)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserReviewTokenResponse.java (1 hunks)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (2 hunks)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (2 hunks)
  • src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: thezz9
PR: ezcode-my/backend#114
File: src/main/java/org/ezcode/codetest/infrastructure/github/GitHubApiClient.java:159-165
Timestamp: 2025-06-28T02:03:38.693Z
Learning: User thezz9's service (ezcode) targets Korean users exclusively ("찐 한국인밖에 안 옴"), so Korean language hardcoding in commit messages and UI elements is intentional and appropriate for their use case.
Learnt from: chat26666
PR: ezcode-my/backend#37
File: src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDsl.java:10-10
Timestamp: 2025-06-06T19:56:27.759Z
Learning: When user chat26666 mentions that code was implemented in a previous PR but explanation was missing, they may submit a follow-up PR just to add documentation/explanation without the actual implementation code.
Learnt from: thezz9
PR: ezcode-my/backend#75
File: src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java:142-147
Timestamp: 2025-06-19T07:00:53.895Z
Learning: SubmissionService.getCodeReview() 메서드에서 토큰 차감을 리뷰 요청 전에 수행하는 이유: OpenAI 서버 장애보다 유저 토큰 부족 상황이 더 빈번하므로, 확률이 높은 실패 케이스를 먼저 체크하여 불필요한 처리를 방지함. OpenAI 서버 장애 시에는 OpenAIClient에서 트랜잭션 롤백으로 토큰 복원이 처리됨.
Learnt from: minjee2758
PR: ezcode-my/backend#43
File: src/main/java/org/ezcode/codetest/domain/user/model/entity/User.java:77-89
Timestamp: 2025-06-10T02:13:33.890Z
Learning: 이 프로젝트에서는 입력 검증을 DTO 레벨에서 수행하고 있으며, User 엔티티의 팩토리 메서드에서는 별도의 입력 검증을 하지 않는다.
Learnt from: minjee2758
PR: ezcode-my/backend#110
File: src/main/java/org/ezcode/codetest/domain/user/service/CustomOAuth2UserService.java:102-112
Timestamp: 2025-06-27T06:03:05.761Z
Learning: `CustomOAuth2UserService`의 `updateGithubUrl` 메서드는 새로운 유저 생성 시나 기존 유저가 새로운 AuthType을 추가할 때만 호출되므로, `UserGithubInfo` 중복 생성 가능성이 없다. 별도의 중복 체크 로직이 불필요하다.
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (2)
Learnt from: thezz9
PR: ezcode-my/backend#75
File: src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java:142-147
Timestamp: 2025-06-19T07:00:53.895Z
Learning: SubmissionService.getCodeReview() 메서드에서 토큰 차감을 리뷰 요청 전에 수행하는 이유: OpenAI 서버 장애보다 유저 토큰 부족 상황이 더 빈번하므로, 확률이 높은 실패 케이스를 먼저 체크하여 불필요한 처리를 방지함. OpenAI 서버 장애 시에는 OpenAIClient에서 트랜잭션 롤백으로 토큰 복원이 처리됨.
Learnt from: NCookies
PR: ezcode-my/backend#17
File: src/main/java/org/ezcode/codetest/presentation/problemmanagement/ProblemAdminController.java:25-25
Timestamp: 2025-06-02T06:57:37.929Z
Learning: 이 프로젝트에서는 아직 Spring Security가 적용되지 않아서 @PreAuthorize 어노테이션이 주석 처리되어 있음. Spring Security 도입 전까지는 권한 검증 어노테이션들이 비활성화 상태임.
src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java (2)
Learnt from: chat26666
PR: ezcode-my/backend#64
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java:0-0
Timestamp: 2025-06-15T04:37:29.231Z
Learning: EncounterChoiceRepositoryImpl in src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java is intentionally a skeleton implementation that is work-in-progress and will be completed later.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainService.java:131-134
Timestamp: 2025-06-17T15:06:54.036Z
Learning: GameEncounterDomainService의 getRandomEnemyCharacter 메소드에서 findRandomCharacter 결과가 빈 리스트일 경우에 대한 예외 처리는 불필요함. 시스템에 항상 테스트 계정이 존재하도록 설계되어 있어 빈 결과가 발생하지 않음.
🧬 Code Graph Analysis (1)
src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserReviewTokenResponse.java (1)
src/main/java/org/ezcode/codetest/common/security/util/JwtFilter.java (1)
  • AllArgsConstructor (28-103)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (6)
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1)

9-9: import 구문이 올바르게 추가되었습니다.

새로운 UserReviewTokenResponse DTO 클래스를 사용하기 위한 필요한 import가 적절히 추가되었습니다.

src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (1)

9-9: import 구문이 올바르게 추가되었습니다.

새로운 UserReviewTokenResponse DTO 클래스를 사용하기 위한 필요한 import가 적절히 추가되었습니다.

src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserReviewTokenResponse.java (1)

1-10: 새로운 DTO 클래스가 올바르게 구현되었습니다.

UserReviewTokenResponse 클래스가 적절히 설계되었습니다:

  • Lombok 어노테이션을 올바르게 사용했습니다.
  • 필드가 final로 선언되어 불변 객체로 구현되었습니다.
  • 패키지 구조가 적절합니다.
src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java (3)

174-186: 닉네임 생성 테스트가 잘 구현되었습니다.

닉네임 생성 기능에 대한 테스트가 적절히 작성되었습니다:

  • 정상적인 닉네임 생성 케이스를 테스트합니다.
  • 최대 시도 횟수 초과 시 예외 발생 케이스를 커버합니다.
  • 적절한 모킹과 어설션을 사용하고 있습니다.

188-212: 리뷰 토큰 관리 테스트가 잘 구현되었습니다.

리뷰 토큰 감소 기능에 대한 테스트가 적절히 작성되었습니다:

  • 토큰이 충분할 때의 정상적인 감소 동작을 테스트합니다.
  • 토큰이 부족할 때 올바른 예외가 발생하는지 확인합니다.
  • 예외 코드까지 정확히 검증하고 있습니다.

215-220: 이메일로 사용자 조회 테스트가 적절히 구현되었습니다.

이메일을 통한 사용자 조회 기능에 대한 테스트가 올바르게 작성되었습니다:

  • 적절한 모킹을 사용하고 있습니다.
  • 반환값을 정확히 검증하고 있습니다.

@pokerbearkr
Copy link
Contributor

경오님 일할거 올라왔네요...
AMI 자동화도 만들어야하나

Copy link

@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: 0

🧹 Nitpick comments (2)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java (1)

27-27: 데이터베이스 이식성을 위해 날짜 추출 방식을 개선하세요.

현재 DATE() 함수는 MySQL 특정 함수로, 다른 데이터베이스에서는 작동하지 않을 수 있습니다. 더 이식성이 좋은 방법을 사용하는 것을 권장합니다.

다음과 같이 개선할 수 있습니다:

-        var date = Expressions.dateTemplate(java.sql.Date.class, "DATE({0})", upr.modifiedAt);
+        var date = upr.modifiedAt.date();

또는 타임존을 고려해야 한다면:

-        var date = Expressions.dateTemplate(java.sql.Date.class, "DATE({0})", upr.modifiedAt);
+        var date = Expressions.dateTemplate(java.sql.Date.class, "CAST({0} AS DATE)", upr.modifiedAt);
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1)

107-112: Swagger 문서화가 누락되었습니다.

다른 엔드포인트들과 일관성을 위해 @Operation 어노테이션을 추가해주세요.

다음과 같이 어노테이션을 추가하세요:

+	@Operation(summary = "회원 일별 해결 문제 기록 조회", description = "회원의 일별 해결한 문제 개수를 조회합니다.")
	@GetMapping("/users/daily-solved")
	public ResponseEntity<UserDailySolvedHistoryResponse> getUserDailySolvedHistory(
		@AuthenticationPrincipal AuthUser authUser
	){
		return ResponseEntity.status(HttpStatus.OK).body(userService.getUserDailySolvedHistory(authUser));
	}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65a132f and 3a622cb.

📒 Files selected for processing (12)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserDailySolvedHistoryResponse.java (1 hunks)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (2 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/dto/DailyCorrectCount.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/repository/UserProblemResultRepository.java (2 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java (3 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/openai/OpenAIReviewClient.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/impl/UserProblemResultRepositoryImpl.java (3 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepository.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java (1 hunks)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (2 hunks)
  • src/main/resources/templates/submit-test.html (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/main/resources/templates/submit-test.html
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserDailySolvedHistoryResponse.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java
  • src/test/java/org/ezcode/codetest/domain/user/UserDomainServiceTest.java
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: thezz9
PR: ezcode-my/backend#114
File: src/main/java/org/ezcode/codetest/infrastructure/github/GitHubApiClient.java:159-165
Timestamp: 2025-06-28T02:03:38.693Z
Learning: User thezz9's service (ezcode) targets Korean users exclusively ("찐 한국인밖에 안 옴"), so Korean language hardcoding in commit messages and UI elements is intentional and appropriate for their use case.
Learnt from: chat26666
PR: ezcode-my/backend#37
File: src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDsl.java:10-10
Timestamp: 2025-06-06T19:56:27.759Z
Learning: When user chat26666 mentions that code was implemented in a previous PR but explanation was missing, they may submit a follow-up PR just to add documentation/explanation without the actual implementation code.
Learnt from: thezz9
PR: ezcode-my/backend#75
File: src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java:142-147
Timestamp: 2025-06-19T07:00:53.895Z
Learning: SubmissionService.getCodeReview() 메서드에서 토큰 차감을 리뷰 요청 전에 수행하는 이유: OpenAI 서버 장애보다 유저 토큰 부족 상황이 더 빈번하므로, 확률이 높은 실패 케이스를 먼저 체크하여 불필요한 처리를 방지함. OpenAI 서버 장애 시에는 OpenAIClient에서 트랜잭션 롤백으로 토큰 복원이 처리됨.
Learnt from: thezz9
PR: ezcode-my/backend#73
File: src/main/java/org/ezcode/codetest/infrastructure/openai/OpenAIReviewClient.java:52-64
Timestamp: 2025-06-18T11:42:03.701Z
Learning: OpenAI API 클라이언트에서는 두 가지 재시도 전략을 사용한다: 1) WebClient의 retryWhen은 네트워크/HTTP 에러 및 타임아웃에 대한 재시도, 2) 외부 for 루프는 API 응답 포맷 검증 실패에 대한 재시도. 이는 서로 다른 실패 상황을 처리하는 독립적인 메커니즘이다.
src/main/java/org/ezcode/codetest/infrastructure/openai/OpenAIReviewClient.java (1)
Learnt from: thezz9
PR: ezcode-my/backend#73
File: src/main/java/org/ezcode/codetest/infrastructure/openai/OpenAIReviewClient.java:52-64
Timestamp: 2025-06-18T11:42:03.701Z
Learning: OpenAI API 클라이언트에서는 두 가지 재시도 전략을 사용한다: 1) WebClient의 retryWhen은 네트워크/HTTP 에러 및 타임아웃에 대한 재시도, 2) 외부 for 루프는 API 응답 포맷 검증 실패에 대한 재시도. 이는 서로 다른 실패 상황을 처리하는 독립적인 메커니즘이다.
src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java (1)
Learnt from: thezz9
PR: ezcode-my/backend#30
File: src/main/java/org/ezcode/codetest/domain/problem/service/SubmissionDomainService.java:24-33
Timestamp: 2025-06-04T13:12:28.354Z
Learning: The submission evaluation system is currently in testing phase, so hardcoded expected output values like "12" are intentionally used for testing purposes rather than being a production issue.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepository.java (1)
Learnt from: chat26666
PR: ezcode-my/backend#64
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java:0-0
Timestamp: 2025-06-15T04:37:29.231Z
Learning: EncounterChoiceRepositoryImpl in src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java is intentionally a skeleton implementation that is work-in-progress and will be completed later.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/impl/UserProblemResultRepositoryImpl.java (2)
Learnt from: chat26666
PR: ezcode-my/backend#64
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java:0-0
Timestamp: 2025-06-15T04:37:29.231Z
Learning: EncounterChoiceRepositoryImpl in src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java is intentionally a skeleton implementation that is work-in-progress and will be completed later.
Learnt from: Kimminu7
PR: ezcode-my/backend#133
File: src/test/java/org/ezcode/codetest/domain/problem/service/ProblemDomainServiceTest.java:92-99
Timestamp: 2025-07-02T12:05:54.895Z
Learning: ProblemDomainService의 removeProblem 메서드는 DB에서 Problem을 삭제한 후 Elasticsearch에서도 해당 ProblemSearchDocument를 찾아서 삭제합니다. 만약 Elasticsearch에서 문서를 찾지 못하면 ProblemException(PROBLEM_NOT_FOUND)을 던지므로, 테스트에서는 problem.getId()와 searchRepository.findById() 모두 적절하게 mock해야 합니다.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java (1)
Learnt from: chat26666
PR: ezcode-my/backend#64
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java:0-0
Timestamp: 2025-06-15T04:37:29.231Z
Learning: EncounterChoiceRepositoryImpl in src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/EncounterChoiceRepositoryImpl.java is intentionally a skeleton implementation that is work-in-progress and will be completed later.
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (4)
Learnt from: thezz9
PR: ezcode-my/backend#75
File: src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java:142-147
Timestamp: 2025-06-19T07:00:53.895Z
Learning: SubmissionService.getCodeReview() 메서드에서 토큰 차감을 리뷰 요청 전에 수행하는 이유: OpenAI 서버 장애보다 유저 토큰 부족 상황이 더 빈번하므로, 확률이 높은 실패 케이스를 먼저 체크하여 불필요한 처리를 방지함. OpenAI 서버 장애 시에는 OpenAIClient에서 트랜잭션 롤백으로 토큰 복원이 처리됨.
Learnt from: NCookies
PR: ezcode-my/backend#17
File: src/main/java/org/ezcode/codetest/presentation/problemmanagement/ProblemAdminController.java:25-25
Timestamp: 2025-06-02T06:57:37.929Z
Learning: 이 프로젝트에서는 아직 Spring Security가 적용되지 않아서 @PreAuthorize 어노테이션이 주석 처리되어 있음. Spring Security 도입 전까지는 권한 검증 어노테이션들이 비활성화 상태임.
Learnt from: minjee2758
PR: ezcode-my/backend#43
File: src/main/java/org/ezcode/codetest/domain/user/model/entity/User.java:77-89
Timestamp: 2025-06-10T02:13:33.890Z
Learning: 이 프로젝트에서는 입력 검증을 DTO 레벨에서 수행하고 있으며, User 엔티티의 팩토리 메서드에서는 별도의 입력 검증을 하지 않는다.
Learnt from: minjee2758
PR: ezcode-my/backend#110
File: src/main/java/org/ezcode/codetest/domain/user/service/CustomOAuth2UserService.java:102-112
Timestamp: 2025-06-27T06:03:05.761Z
Learning: `CustomOAuth2UserService`의 `updateGithubUrl` 메서드는 새로운 유저 생성 시나 기존 유저가 새로운 AuthType을 추가할 때만 호출되므로, `UserGithubInfo` 중복 생성 가능성이 없다. 별도의 중복 체크 로직이 불필요하다.
🧬 Code Graph Analysis (1)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java (1)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/impl/UserProblemResultRepositoryImpl.java (1)
  • Repository (16-53)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (9)
src/main/java/org/ezcode/codetest/domain/submission/repository/UserProblemResultRepository.java (1)

7-7: 새로운 일일 정답 수 조회 기능 추가가 적절합니다.

DailyCorrectCount DTO 임포트와 countCorrectByUserGroupedByDate 메소드 추가가 잘 구현되었습니다. 메소드 시그니처와 반환 타입이 명확하고 도메인 레이어의 repository 인터페이스에 적절히 위치했습니다.

Also applies to: 23-23

src/main/java/org/ezcode/codetest/infrastructure/openai/OpenAIReviewClient.java (1)

86-86: OpenAI API 타임아웃 증가가 적절합니다.

타임아웃을 10초에서 20초로 증가시킨 것은 AI 리뷰 토큰 기능의 안정성을 향상시키는 좋은 변경입니다. 네트워크 지연이나 OpenAI 서버 응답 시간 변동에 더 유연하게 대처할 수 있습니다.

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepository.java (1)

1-9: 쿼리 전용 Repository 인터페이스 분리가 잘 구현되었습니다.

복잡한 집계 쿼리를 위한 별도의 인터페이스를 생성하여 책임을 적절히 분리했습니다. 패키지 구조와 메소드 시그니처가 명확하고 QueryDSL을 활용한 구현을 위한 좋은 설계입니다.

src/main/java/org/ezcode/codetest/domain/submission/dto/DailyCorrectCount.java (1)

1-12: 잘 설계된 DTO record 클래스입니다.

LocalDateint 필드를 가진 record 클래스가 적절하게 구현되었습니다. java.sql.Date를 받는 추가 생성자는 데이터베이스 쿼리 결과와의 호환성을 위한 실용적인 접근법입니다. 불변 데이터 전송을 위한 record 사용이 적절합니다.

src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java (2)

8-8: 로깅 기능 추가가 적절합니다.

@Slf4j 어노테이션과 필요한 임포트가 추가되어 향후 로깅 요구사항에 대비할 수 있습니다.

Also applies to: 22-24


91-93: 일일 해결 이력 조회 메소드가 잘 구현되었습니다.

getSolvedHistoryByDate 메소드가 도메인 서비스 레이어에 적절히 위치하며, repository 호출을 깔끔하게 위임하는 구조입니다. 메소드명과 반환 타입이 명확하고 단일 책임 원칙을 잘 따르고 있습니다.

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/impl/UserProblemResultRepositoryImpl.java (1)

7-7: 새로운 메서드 추가가 적절합니다.

QueryRepository에 작업을 위임하는 표준 패턴을 따르고 있으며, 기존 메서드들과 일관된 구조를 유지하고 있습니다.

Also applies to: 11-11, 21-21, 48-51

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/submission/query/UserProblemResultQueryRepositoryImpl.java (1)

29-41: QueryDSL 쿼리 구조가 적절합니다.

사용자별 일별 정답 개수를 집계하는 쿼리 로직이 올바르게 구현되어 있습니다.

src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1)

99-105: 리뷰 토큰 조회 API가 적절하게 구현되었습니다.

엔드포인트 구조, 인증 처리, 응답 형식이 모두 올바르게 구현되어 있습니다.

@minjee2758 minjee2758 merged commit 14512d1 into dev Jul 5, 2025
2 checks passed
@minjee2758 minjee2758 deleted the test/userService branch July 5, 2025 05:44
@coderabbitai coderabbitai bot mentioned this pull request Jul 6, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jul 15, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 5, 2025
3 tasks
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.

5 participants