Skip to content

Conversation

@chat26666
Copy link
Collaborator

@chat26666 chat26666 commented Jun 26, 2025


작업 내용

  • 문제 카테고리 < - > 중간 테이블 <-> 문제 이렇게 나눴습니다. 추가적으로 검색엔진쪽 게임쪽 전부 손봤고 submissionservice 쪽도 로직 변경됐어요

Summary by CodeRabbit

  • 신규 기능

    • 문제 카테고리 관리 기능이 추가되어, 카테고리 생성 및 문제-카테고리 연동이 지원됩니다.
    • 카테고리별 능력치 증가율이 데이터베이스에 저장되어 캐릭터 성장에 반영됩니다.
  • 기능 개선

    • 문제 생성, 수정, 조회 시 카테고리를 코드 및 한글명으로 입력·출력할 수 있도록 인터페이스가 변경되었습니다.
    • 문제 목록, 상세, 검색 결과에서 카테고리 정보가 문자열(한글명)로 제공됩니다.
  • 버그 수정

    • 카테고리 관련 예외 메시지가 추가되어, 존재하지 않는 카테고리 선택 시 명확한 안내가 제공됩니다.
  • 테스트

    • 게임 및 캐릭터 관련 신규 테스트 클래스가 추가되었습니다.
  • 기타

    • 기존 카테고리 enum 방식이 엔티티 기반으로 전환되어, 유연한 카테고리 관리가 가능합니다.
    • 일부 불필요한 파일 및 컨트롤러가 삭제되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Jun 26, 2025

Walkthrough

이 변경 사항은 문제 카테고리 시스템을 기존 enum 기반에서 영속적인 DB 엔티티 기반으로 전환합니다. 카테고리와 문제의 관계는 다대다 매핑(ProblemCategory)으로 관리되며, 관련 DTO, 서비스, 리포지토리, 컨트롤러, 검색, 캐싱, 게임 통계 로직 전반이 이에 맞게 리팩토링되었습니다. 기존 enum, 관련 메소드, 테스트, 컨트롤러 등은 모두 제거되거나 대체되었습니다.

Changes

파일/경로 요약 변경 내용 요약
.../dto/request/CategoryCreateRequest.java
.../domain/problem/model/entity/Category.java
.../domain/problem/model/entity/ProblemCategory.java
.../domain/problem/repository/CategoryRepository.java
.../domain/problem/repository/ProblemCategoryRepository.java
.../infrastructure/persistence/repository/problem/CategoryJpaRepository.java
.../infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java
.../infrastructure/persistence/repository/problem/ProblemCategoryJpaRepository.java
.../infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.java
카테고리 관련 엔티티, DTO, 리포지토리, JPA 및 구현체 신규 추가 및 enum 기반 구조 제거
.../dto/request/ProblemCreateRequest.java
.../dto/request/ProblemUpdateRequest.java
.../dto/response/ProblemDetailResponse.java
.../dto/response/ProblemResponse.java
.../dto/response/ProblemSearchResponse.java
문제 관련 DTO의 카테고리 필드 타입을 enum/엔티티에서 String/Map 등으로 변경 및 매핑 로직 수정
.../service/ProblemService.java
.../service/ProblemDomainService.java
문제 생성/수정/조회/목록 서비스에서 카테고리 연관 처리, 반환 타입, 매핑 로직 전면 수정 및 신규 메소드 추가
.../model/ProblemInfo.java
.../model/ProblemSearchCondition.java
.../model/entity/Problem.java
.../model/entity/ProblemSearchDocument.java
문제 엔티티, 검색 도큐먼트, 검색 조건 등에서 카테고리 필드 및 생성/업데이트/매핑 방식 변경
.../presentation/problemmanagement/problem/ProblemAdminController.java
.../presentation/problemmanagement/problem/ProblemController.java
문제/카테고리 관리 컨트롤러의 파라미터, 반환 타입, 신규 엔드포인트 추가 및 카테고리 enum 제거
.../application/submission/model/SubmissionContext.java
.../domain/submission/model/SubmissionResult.java
.../domain/submission/model/entity/UserProblemResult.java
.../domain/submission/service/SubmissionDomainService.java
채점 및 제출 관련 모델, 서비스에서 카테고리 정보 제공 방식 변경 및 관련 메소드 시그니처 수정
.../domain/game/model/character/CategoryStat.java
.../domain/game/repository/CategoryStatRepository.java
.../infrastructure/persistence/repository/game/mysql/character/CategoryStatJpaRepository.java
.../infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java
카테고리별 스탯 증가율 영속화 엔티티/리포지토리/캐싱 신규 도입 및 관련 로직 구현
.../domain/game/exception/GameExceptionCode.java
.../domain/game/service/CharacterStatusDomainService.java
.../domain/game/util/StatUpdateUtil.java
게임 캐릭터 스탯 증가 로직에서 카테고리별 DB 기반 증가율 사용, 예외 처리 및 캐싱 적용
.../infrastructure/cache/config/CaffeineCacheConfig.java 카테고리 스탯 캐시 추가
.../infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java
.../infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java
엘라스틱서치 색인/검색 필드명 및 카테고리 처리 방식 변경
.../infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java 문제 카테고리 검색 조건 필터링 로직 비활성화(주석 처리)
.../domain/problem/model/enums/Category.java
.../domain/studygroup/model/StudyGroupUser.java
.../domain/studygroup/service/StudyGroupDomainService.java
.../presentation/game/play/TestGamePlayController.java
기존 카테고리 enum, 스터디그룹 관련 엔티티/서비스, 테스트 컨트롤러 등 삭제
src/main/resources/elasticsearch/my_index-settings.json 엘라스틱서치 stoptags 일부 제거
src/test/java/... 게임, 문제 관련 신규 테스트 클래스 다수 추가 및 테스트 환경 설정 변경

Sequence Diagram(s)

sequenceDiagram
actor Admin
Admin->>ProblemAdminController: POST /categories (CategoryCreateRequest)
ProblemAdminController->>ProblemService: createCategory(requestDto)
ProblemService->>ProblemDomainService: createCategory(category)
ProblemDomainService->>CategoryRepository: save(category)
ProblemDomainService->>CategoryStatRepository: save(new CategoryStat(category))
CategoryRepository-->>ProblemDomainService: Category
CategoryStatRepository-->>ProblemDomainService: CategoryStat
ProblemDomainService-->>ProblemService: Category
ProblemService-->>ProblemAdminController: (void)
ProblemAdminController-->>Admin: 201 Created
Loading
sequenceDiagram
actor User
User->>ProblemController: GET /problems?categoryCode=...
ProblemController->>ProblemService: getProblemsList(pageable, searchCondition)
ProblemService->>ProblemDomainService: getProblemsList(...)
ProblemDomainService->>ProblemCategoryRepository: findByProblemIdsIn(...)
ProblemCategoryRepository-->>ProblemDomainService: List<ProblemCategory>
ProblemDomainService->>CategoryRepository: findAllByCategoryCodeIn(...)
CategoryRepository-->>ProblemDomainService: List<Category>
ProblemDomainService-->>ProblemService: List<ProblemInfo>
ProblemService->>ProblemResponse: from(problem, categories)
ProblemService-->>ProblemController: Page<ProblemResponse>
ProblemController-->>User: Page<ProblemResponse>
Loading

Possibly related PRs

  • refactor : category 리팩토링 #107: 이전 PR도 문제 카테고리 구조를 enum에서 리스트로 리팩토링하였으나, 이번 PR은 DB 엔티티 및 리포지토리 기반으로 더 확장된 구조적 변경을 포함합니다.

Suggested reviewers

  • minjee2758
  • Kimminu7
  • pokerbearkr
  • thezz9

Poem

🐰
카테고리 enum은 안녕,
DB 엔티티가 새로이 등장!
문제와 카테고리, 다대다로 손잡고
캐시와 스탯, 통계도 척척
테스트도 빼곡, 리팩토링 완성
코드를 hop-hop 뛰며
토끼는 오늘도 기뻐해요!
🥕✨


📜 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 25e6299 and 7ff82ea.

📒 Files selected for processing (1)
  • src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java
✨ 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.

# Conflicts:
#	src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java
#	src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java
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: 16

🔭 Outside diff range comments (1)
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (1)

39-54: categories 파라미터에 대한 null 체크를 추가하세요.

from 메서드에서 categories 파라미터가 null일 경우를 처리해야 합니다. 현재 코드는 categories.stream()에서 NullPointerException이 발생할 수 있습니다.

	public static ProblemResponse from(Problem problem, List<Category> categories) {

		if (problem == null) {
			throw new IllegalArgumentException("문제는 null 값이 아니어야 합니다.");
		}
+		
+		if (categories == null) {
+			throw new IllegalArgumentException("카테고리 목록은 null 값이 아니어야 합니다.");
+		}

		return ProblemResponse.builder()
			.id(problem.getId())
			.creator(problem.getCreator() != null ? problem.getCreator().getNickname() : "존재하지 않는 이름.")
			.categories(categories.stream().map(Category::getCategoryKorName).toList())
			.title(problem.getTitle())
			.score(problem.getScore())
			.difficulty(problem.getDifficulty())
			.reference(problem.getReference())
			.build();
	}
🧹 Nitpick comments (12)
src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.java (1)

3-3: 사용되지 않는 정적 임포트는 제거하세요
org.junit.jupiter.api.Assertions.* 를 사용하지 않고 있습니다. 불필요한 임포트는 IDE-경고 및 코드 가독성에 불필요한 노이즈를 추가합니다.

-import static org.junit.jupiter.api.Assertions.*;
+// import 제거
src/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java (1)

3-3: 불필요한 Assertions 와일드카드 임포트
해당 파일에서도 Assertions 메서드가 사용되지 않습니다.

-import static org.junit.jupiter.api.Assertions.*;
src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java (1)

3-3: Assertions 임포트가 사용되지 않습니다

-import static org.junit.jupiter.api.Assertions.*;
src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.java (1)

3-3: 미사용 Assertions 임포트 제거 권장

-import static org.junit.jupiter.api.Assertions.*;
src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.java (1)

3-3: 사용되지 않는 와일드카드 임포트

-import static org.junit.jupiter.api.Assertions.*;
src/test/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainServiceTest.java (1)

5-7: 향후 테스트 메소드 구현 필요

현재 빈 테스트 클래스 상태입니다. GameEncounterDomainService의 기능을 검증하는 테스트 메소드들을 추가해주세요.

src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java (1)

74-75: 불필요한 빈 줄 제거

코드 가독성을 위해 불필요한 빈 줄들을 제거해주세요.

-
-
	@BeforeEach
	void setUp() {
		// ... setup code ...
-	}
-
+	}

	@Nested

Also applies to: 146-147, 216-217

src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (2)

34-34: 필드 접근 제한자 일관성 문제

다른 필드들은 private 접근 제한자를 사용하는데 id 필드만 패키지 수준 접근성을 가지고 있습니다.

-	Long id;
+	private Long id;

30-57: JPA 엔티티 최적화 권장사항

JPA 엔티티의 올바른 동작을 위해 equals()hashCode() 메서드 구현을 고려해보세요. 특히 컬렉션에서 사용되거나 연관관계 관리 시 중요합니다.

+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (!(o instanceof ProblemCategory that)) return false;
+		return Objects.equals(problem.getId(), that.problem.getId()) &&
+			   Objects.equals(category.getId(), that.category.getId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(problem.getId(), category.getId());
+	}
src/main/java/org/ezcode/codetest/domain/problem/repository/ProblemCategoryRepository.java (1)

7-18: 레포지토리 인터페이스 설계가 적절함

ProblemCategory 엔티티 관리를 위한 메서드들이 잘 정의되어 있습니다. 다만, 성능 최적화를 위해 배치 조회 메서드에 대한 고려사항이 있습니다.

  • findByProblemIdsIn: 대량 데이터 조회 시 N+1 문제 방지를 위해 적절히 설계됨
  • deleteAllByProblemId: 문제 업데이트 시 기존 카테고리 연관 관계 정리에 유용

대용량 데이터 처리 시 성능을 위해 페이징 지원을 고려해보세요:

Page<ProblemCategory> findByProblemId(Long problemId, Pageable pageable);
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java (1)

27-30: 생성자 파라미터 이름을 개선하세요.

생성자의 첫 번째 파라미터 이름이 category로 되어 있는데, 실제로는 categoryCode를 의미합니다. 가독성을 위해 필드명과 일치하도록 변경하는 것이 좋겠습니다.

-	public Category (String category, String categoryKor) {
-		this.categoryCode = category;
+	public Category (String categoryCode, String categoryKor) {
+		this.categoryCode = categoryCode;
		this.categoryKorName = categoryKor;
	}
src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java (1)

74-83: 카테고리 매핑 로직을 별도 메서드로 추출하면 가독성이 향상됩니다.

문제와 카테고리를 매핑하는 로직을 별도의 private 메서드로 추출하는 것을 고려해보세요.

+private Map<Problem, List<Category>> mapProblemsToCategories(List<ProblemCategory> categories) {
+    return categories.stream()
+        .collect(Collectors.groupingBy(
+            ProblemCategory::getProblem,
+            Collectors.mapping(ProblemCategory::getCategory, Collectors.toList())
+        ));
+}

 Map<Problem, List<Category>> maps = categories.stream()
     .collect(Collectors.groupingBy(
         ProblemCategory::getProblem,
         Collectors.mapping(ProblemCategory::getCategory, Collectors.toList())
     ));
+// 위 코드를 다음으로 변경:
+Map<Problem, List<Category>> maps = mapProblemsToCategories(categories);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 60499a2 and 189e2d7.

📒 Files selected for processing (43)
  • src/main/java/org/ezcode/codetest/application/problem/dto/request/CategoryCreateRequest.java (1 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java (4 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java (1 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java (3 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (4 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemSearchResponse.java (1 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/service/ProblemSearchService.java (0 hunks)
  • src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java (4 hunks)
  • src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java (2 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/ProblemSearchCondition.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (3 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java (5 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/model/enums/Category.java (0 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/repository/CategoryRepository.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/repository/ProblemCategoryRepository.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java (2 hunks)
  • src/main/java/org/ezcode/codetest/domain/studygroup/model/StudyGroupUser.java (0 hunks)
  • src/main/java/org/ezcode/codetest/domain/studygroup/service/StudyGroupDomainService.java (0 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/model/SubmissionResult.java (1 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/model/entity/UserProblemResult.java (0 hunks)
  • src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java (2 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java (4 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryJpaRepository.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryJpaRepository.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.java (1 hunks)
  • src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java (1 hunks)
  • src/main/java/org/ezcode/codetest/presentation/game/play/TestGamePlayController.java (0 hunks)
  • src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java (3 hunks)
  • src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java (1 hunks)
  • src/main/resources/application.properties (2 hunks)
  • src/main/resources/elasticsearch/my_index-settings.json (1 hunks)
  • src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainServiceTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.java (1 hunks)
  • src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.java (1 hunks)
  • src/test/resources/application-test.properties (1 hunks)
💤 Files with no reviewable changes (6)
  • src/main/java/org/ezcode/codetest/application/problem/service/ProblemSearchService.java
  • src/main/java/org/ezcode/codetest/domain/submission/model/entity/UserProblemResult.java
  • src/main/java/org/ezcode/codetest/domain/studygroup/service/StudyGroupDomainService.java
  • src/main/java/org/ezcode/codetest/presentation/game/play/TestGamePlayController.java
  • src/main/java/org/ezcode/codetest/domain/problem/model/enums/Category.java
  • src/main/java/org/ezcode/codetest/domain/studygroup/model/StudyGroupUser.java
🧰 Additional context used
🧠 Learnings (32)
📓 Common learnings
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#36
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemLanguage.java:3-3
Timestamp: 2025-06-06T07:57:51.226Z
Learning: 사용자 thezz9는 Language 엔티티를 Submission 도메인으로 이동시킨 이유가 "제출하려면 필요해서"라고 설명했으며, Problem 도메인과 Submission 도메인 간의 종속성 위반 문제에 대한 해결 방안을 고민하고 있다.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
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/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java (4)
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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
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 결과가 빈 리스트일 경우에 대한 예외 처리는 불필요함. 시스템에 항상 테스트 계정이 존재하도록 설계되어 있어 빈 결과가 발생하지 않음.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/domain/game/service/CharacterEquipService.java:26-34
Timestamp: 2025-06-16T16:07:34.354Z
Learning: 이 프로젝트에서는 UseCase 레벨에서 트랜잭션 경계를 관리하므로, 도메인 서비스 클래스들(예: CharacterEquipService)에는 @Transactional 어노테이션이 필요하지 않습니다. 트랜잭션은 UseCase에서 열리므로 데이터 일관성이 보장됩니다.
src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java (3)
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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/application/game/play/GamePlayUseCase.java:99-105
Timestamp: 2025-06-16T17:19:57.100Z
Learning: In GamePlayUseCase.java, the unEquipSkill method intentionally accepts only skill name (via SkillUnEquipRequest) for convenience, rather than including slotNumber. This design choice prioritizes user experience over potential future extensibility concerns where the same skill might be equipped in multiple slots.
src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
src/test/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainServiceTest.java (3)
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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
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 결과가 빈 리스트일 경우에 대한 예외 처리는 불필요함. 시스템에 항상 테스트 계정이 존재하도록 설계되어 있어 빈 결과가 발생하지 않음.
src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.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/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
src/main/java/org/ezcode/codetest/domain/problem/model/ProblemSearchCondition.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryJpaRepository.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#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/domain/problem/repository/CategoryRepository.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#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemSearchResponse.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
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#31
File: src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java:25-27
Timestamp: 2025-06-04T15:11:19.343Z
Learning: In ProblemDomainService, when saving problems to both database and Elasticsearch, maintain transactional consistency by allowing rollback if either save operation fails. Data integrity between DB and ES is prioritized over availability - if Elasticsearch save fails, the entire transaction should roll back to prevent data inconsistency.
src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java (4)
Learnt from: thezz9
PR: ezcode-my/backend#36
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemLanguage.java:3-3
Timestamp: 2025-06-06T07:57:51.226Z
Learning: 사용자 thezz9는 Language 엔티티를 Submission 도메인으로 이동시킨 이유가 "제출하려면 필요해서"라고 설명했으며, Problem 도메인과 Submission 도메인 간의 종속성 위반 문제에 대한 해결 방안을 고민하고 있다.
Learnt from: thezz9
PR: ezcode-my/backend#98
File: src/main/java/org/ezcode/codetest/application/submission/dto/event/SubmissionErrorEvent.java:17-22
Timestamp: 2025-06-25T01:24:30.754Z
Learning: JudgeClient에서 모든 예외를 SubmissionException으로 래핑해서 넘길 계획이므로, SubmissionErrorEvent.resolveCode() 메서드의 캐스팅은 안전할 예정임.
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#36
File: src/main/java/org/ezcode/codetest/application/submission/dto/request/compile/CodeCompileRequest.java:5-9
Timestamp: 2025-06-06T07:52:58.941Z
Learning: CodeCompileRequest 레코드의 필드명(source_code, language_id)은 Java camelCase 컨벤션 대신 snake_case를 사용하는데, 이는 Judge0 API의 반환 값 형식에 맞추기 위한 의도적인 설계 결정이다.
src/main/java/org/ezcode/codetest/domain/problem/repository/ProblemCategoryRepository.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
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/application/problem/dto/response/ProblemDetailResponse.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.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#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java:39-44
Timestamp: 2025-06-14T14:55:06.361Z
Learning: ProblemQueryRepositoryImpl에서 String 타입의 difficulty를 Difficulty enum과 비교할 때는 Difficulty.getDifficultyFromKor() 메서드를 사용해서 String을 enum으로 변환한 후 비교해야 한다. 컨트롤러에서 검증 로직을 추가하지 않고 레포지토리 계층에서 타입 변환을 처리하는 것이 관심사 분리 원칙에 적합하다.
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.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#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
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/problem/ProblemCategoryJpaRepository.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
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/infrastructure/persistence/repository/game/mysql/skill/GameCharacterSkillJpaRepository.java:15-17
Timestamp: 2025-06-17T14:46:51.206Z
Learning: GameCharacterSkillJpaRepository에서 findByCharacterId 메서드는 skill 참조를 하지 않기 때문에 @EntityGraph를 사용하지 않는다. 실제 사용 패턴에 따라 선택적으로 eager loading을 적용하는 것이 성능상 더 효율적이다.
src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java (7)
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/CharacterEquipService.java:26-34
Timestamp: 2025-06-16T16:07:34.354Z
Learning: 이 프로젝트에서는 UseCase 레벨에서 트랜잭션 경계를 관리하므로, 도메인 서비스 클래스들(예: CharacterEquipService)에는 @Transactional 어노테이션이 필요하지 않습니다. 트랜잭션은 UseCase에서 열리므로 데이터 일관성이 보장됩니다.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/GameCharacterSkillRepositoryImpl.java:31-34
Timestamp: 2025-06-16T16:11:08.818Z
Learning: In the game domain, the SkillSlotType enum has BACKPACK representing unequipped/inventory status, while SLOT_1, SLOT_2, SLOT_3 represent equipped slots. Therefore, filtering by `slotType != BACKPACK` correctly identifies equipped skills, making the method name `findByCharacterIdAndEquipped` appropriate for this logic.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/application/game/play/GamePlayUseCase.java:99-105
Timestamp: 2025-06-16T17:19:57.100Z
Learning: In GamePlayUseCase.java, the unEquipSkill method intentionally accepts only skill name (via SkillUnEquipRequest) for convenience, rather than including slotNumber. This design choice prioritizes user experience over potential future extensibility concerns where the same skill might be equipped in multiple slots.
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 결과가 빈 리스트일 경우에 대한 예외 처리는 불필요함. 시스템에 항상 테스트 계정이 존재하도록 설계되어 있어 빈 결과가 발생하지 않음.
Learnt from: chat26666
PR: ezcode-my/backend#67
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/skill/GameCharacterSkillJpaRepository.java:15-17
Timestamp: 2025-06-17T14:46:51.206Z
Learning: GameCharacterSkillJpaRepository에서 findByCharacterId 메서드는 skill 참조를 하지 않기 때문에 @EntityGraph를 사용하지 않는다. 실제 사용 패턴에 따라 선택적으로 eager loading을 적용하는 것이 성능상 더 효율적이다.
src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java (1)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java:25-27
Timestamp: 2025-06-04T15:11:19.343Z
Learning: In ProblemDomainService, when saving problems to both database and Elasticsearch, maintain transactional consistency by allowing rollback if either save operation fails. Data integrity between DB and ES is prioritized over availability - if Elasticsearch save fails, the entire transaction should roll back to prevent data inconsistency.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (2)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
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/domain/problem/service/ProblemDomainService.java (3)
Learnt from: Kimminu7
PR: ezcode-my/backend#63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java:25-27
Timestamp: 2025-06-04T15:11:19.343Z
Learning: In ProblemDomainService, when saving problems to both database and Elasticsearch, maintain transactional consistency by allowing rollback if either save operation fails. Data integrity between DB and ES is prioritized over availability - if Elasticsearch save fails, the entire transaction should roll back to prevent data inconsistency.
Learnt from: chat26666
PR: ezcode-my/backend#31
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java:49-56
Timestamp: 2025-06-05T00:52:54.460Z
Learning: ProblemSearchDocument.from() 메서드는 트랜잭션 내에서 DB에서 실제로 조회한 Problem 엔티티만 사용하므로 null 체크가 불필요함. 이 컨텍스트에서는 null Problem이 있을 경우 이미 이전 단계에서 예외가 발생함.
🧬 Code Graph Analysis (2)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (2)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java (1)
  • Entity (12-32)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (1)
  • Getter (29-152)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java (3)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (1)
  • Entity (20-57)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (1)
  • Getter (29-152)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java (1)
  • Getter (20-213)
🔇 Additional comments (43)
src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java (3)

152-175: 테스트 로직 검증 완료

아이템이 삭제되지 않은 경우의 테스트 로직이 올바르게 구현되어 있습니다. Mock 검증과 assertion이 적절합니다.


177-202: 아이템 삭제 시나리오 테스트 로직 우수

아이템이 삭제된 경우의 처리 로직을 잘 검증하고 있습니다. unEquipAllItems() 호출과 equipItem() 호출 횟수 검증이 적절합니다.


76-146: 테스트 데이터 설정 우수

BDD 스타일의 테스트 구조와 도메인 객체들의 적절한 설정이 잘 이루어져 있습니다. 리플렉션을 사용한 ID 설정도 단위 테스트에서 적절한 방식입니다.

src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java (1)

37-43: 양방향 CASCADE DELETE 설정 검토 필요

ProblemCategory 양쪽 모두에 OnDeleteAction.CASCADE가 설정되어 있어 예상치 못한 연쇄 삭제가 발생할 수 있습니다. 특히 카테고리 삭제 시 해당 카테고리를 사용하는 모든 문제의 연관관계가 삭제되는 것이 의도된 동작인지 확인이 필요합니다.

#!/bin/bash
# 다른 JPA 엔티티에서 CASCADE 설정 패턴 확인
rg -A 3 "@OnDelete.*CASCADE" --type java
src/main/resources/elasticsearch/my_index-settings.json (1)

31-31: 한국어 품사 태그 제거에 따른 검색 품질 영향 검증 필요

MAG(일반부사)와 MAJ(접속부사) 태그를 제거하면 부사류 단어들이 검색 인덱싱에 포함되어 검색 결과에 영향을 줄 수 있습니다. 이 변경이 검색 품질에 미치는 영향을 확인해야 합니다.

src/test/resources/application-test.properties (1)

18-18: 테스트 환경에서 스키마 재생성 설정 적절함

카테고리 시스템 리팩토링으로 인한 스키마 변경사항이 많아 create-drop 설정이 테스트 환경에서 적절합니다. 깨끗한 테스트 환경을 보장할 수 있습니다.

src/main/java/org/ezcode/codetest/domain/problem/model/ProblemSearchCondition.java (1)

4-4: 카테고리 타입 변경이 리팩토링 목표와 일치함

Category enum에서 String으로의 타입 변경이 데이터베이스 테이블 기반 카테고리 시스템으로의 전환과 일치합니다. 카테고리 코드를 문자열로 처리하는 새로운 접근 방식에 적합합니다.

src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java (1)

57-57: 카테고리 처리 방식 개선됨

Category enum에서 문자열 기반 처리로의 전환이 올바르게 구현되었습니다. 이는 새로운 Category 엔티티 기반 아키텍처와 일치합니다.

src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java (2)

15-15: 카테고리 필드 타입 변경이 적절함

List에서 List으로의 변경이 새로운 아키텍처와 일치합니다.


37-49: 카테고리 처리 로직 누락 확인 필요

from() 메서드에서 카테고리 설정 로직이 완전히 제거되었습니다. 서비스 레이어에서 별도로 카테고리-문제 연관관계를 처리하는 로직이 구현되어 있는지 확인이 필요합니다.

다음 스크립트로 ProblemService에서 카테고리 처리 로직을 확인해보겠습니다:

#!/bin/bash
# Description: ProblemService에서 문제 업데이트 시 카테고리 처리 로직 확인

# ProblemService의 updateProblem 메서드와 카테고리 관련 로직 검색
ast-grep --pattern $'updateProblem($$$) {
  $$$
}'

# 카테고리 관련 서비스 메서드들 검색
rg -A 10 "updateProblem|createProblemCategory|updateProblemCategories" --type java
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemSearchResponse.java (1)

32-32: 카테고리 응답 처리 간소화됨

document.getCategories()를 직접 할당하는 방식으로 변경되어 더욱 간결하고 효율적인 구현이 되었습니다. 새로운 문자열 기반 카테고리 처리 방식과 잘 일치합니다.

src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java (3)

34-38: Elasticsearch 필드명 변경이 일관되게 적용되었습니다.

단수형 "category"에서 복수형 "categories"로의 변경이 모든 쿼리 타입(match, highlight)에서 일관되게 적용되어 문제당 여러 카테고리를 지원하는 새로운 구조와 잘 맞습니다.


81-85: 정확한 검색 쿼리에서도 필드명이 올바르게 업데이트되었습니다.

term 쿼리에서 "categories.keyword"와 "categoriesKor.keyword" 필드명이 새로운 복수형 구조에 맞게 정확히 변경되었습니다.


92-92: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java 파일의 필드 구성을 명확히 파악하기 위해 추가 스크립트를 실행해 보겠습니다.

#!/bin/bash
# 1) ProblemSearchDocument.java 파일 경로 찾기
file=$(fd --full-path ProblemSearchDocument.java)

# 2) 클래스 선언 및 주요 필드 검색
echo "===== 파일 위치: $file ====="
rg -n "class ProblemSearchDocument" "$file"
rg -n "categories" "$file"
rg -n "categoriesKor" "$file"
src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java (1)

37-41: 카테고리 파라미터 타입 변경이 올바르게 적용되었습니다.

Category enum에서 String categoryCode로의 변경이 새로운 엔티티 기반 카테고리 시스템과 일치하며, ProblemSearchCondition 생성자 호출도 적절히 업데이트되었습니다.

src/main/java/org/ezcode/codetest/domain/submission/model/SubmissionResult.java (1)

21-28: 팩토리 메서드 시그니처 변경이 적절합니다.

카테고리 정보를 명시적으로 파라미터로 전달받도록 변경한 것이 새로운 엔티티 기반 카테고리 시스템과 잘 맞으며, 메서드의 의도가 더 명확해졌습니다.

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryJpaRepository.java (1)

9-14: Category 엔티티를 위한 표준적인 JPA 레포지토리 인터페이스입니다.

필요한 쿼리 메서드들이 명확하게 정의되어 있으며, 메서드명이 직관적이고 용도에 맞습니다. 카테고리 코드 기반 조회 기능이 적절히 제공되고 있습니다.

src/main/java/org/ezcode/codetest/domain/problem/repository/CategoryRepository.java (1)

8-15: 도메인 레벨의 Category 레포지토리 인터페이스가 잘 설계되었습니다.

필요한 CRUD 및 조회 기능이 명확하게 정의되어 있으며, 도메인 서비스에서 사용하기에 적절한 추상화 레벨을 제공합니다. 메서드 시그니처가 일관되고 직관적입니다.

src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java (1)

24-24: 응답 DTO의 카테고리 표현 방식 일관성 확인

categories 필드가 List<String>으로 변경되어 API 응답에서 카테고리를 문자열로 표현하게 되었습니다. 이는 enum에서 entity 기반으로의 전환과 일치하는 변경입니다.

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

35-40: 메서드 시그니처 변경이 적절함

finalizeSubmission 메서드에 categories 파라미터를 추가하여 제출 결과에 카테고리 정보를 포함하도록 개선되었습니다. 이는 전체 시스템의 카테고리 관리 개선과 일치하는 변경입니다.


53-55: SubmissionResult 생성 시 카테고리 정보 전달 일관성 확인

모든 SubmissionResult.from() 호출에서 categories 파라미터가 일관되게 전달되고 있어 좋습니다. 이를 통해 제출 결과에서 문제의 카테고리 정보를 정확하게 제공할 수 있습니다.

Also applies to: 63-63

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java (1)

12-36: 표준적인 레포지토리 구현 패턴 준수

CategoryRepositoryImpl이 도메인 레포지토리 인터페이스를 구현하고 JPA 레포지토리에 위임하는 표준적인 패턴을 잘 따르고 있습니다. 클린 아키텍처의 의존성 역전 원칙을 적절히 적용했습니다.

  • 도메인 계층과 인프라 계층 간의 의존성이 올바르게 분리됨
  • 메서드 구현이 간결하고 명확함
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java (1)

21-25: LGTM! 카테고리 엔티티 구조가 적절합니다.

categoryCodecategoryKorName 필드에 unique 제약조건을 설정한 것이 적절합니다. 이는 중복 카테고리 생성을 방지하고 데이터 무결성을 보장합니다.

src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (1)

23-23: 카테고리 표현 방식 변경이 적절합니다.

List<Category>에서 List<String>으로 변경하여 API 응답에서 카테고리를 한글 이름으로 표현하는 것이 사용자 친화적입니다.

src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java (3)

18-18: 카테고리 데이터 구조 변경이 적절합니다.

Map<String, String>을 사용하여 카테고리 코드와 한글 이름을 함께 받는 구조가 새로운 Category 엔티티 설계와 잘 맞습니다.


47-47: 메서드 이름 변경이 더 명확합니다.

toEntity에서 toProblem으로 변경한 것이 메서드의 실제 기능을 더 명확하게 표현합니다.


29-29: Difficulty enum의 멤버 목록을 확인해 주세요.

#!/bin/bash
rg -A20 "public enum Difficulty" src/main/java/org/ezcode/codetest/domain/problem/model/enums/Difficulty.java
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryJpaRepository.java (2)

12-13: @entitygraph 사용이 적절합니다.

category 속성에 대한 eager loading 설정이 적절합니다. ProblemCategory를 조회할 때 대부분의 경우 연관된 Category 정보도 함께 필요할 것이므로 N+1 문제를 방지할 수 있습니다.


17-18: 벌크 조회 메서드가 성능에 도움이 됩니다.

findByProblemIdIn 메서드를 통해 여러 문제의 카테고리를 한 번에 조회할 수 있어 성능상 이점이 있습니다.

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.java (1)

13-46: LGTM! 표준적인 Repository 구현입니다.

JPA repository에 대한 단순 위임 구조로 되어 있어 깔끔하고 명확합니다. 각 메서드의 책임이 명확하게 분리되어 있습니다.

src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (3)

81-95: 카테고리 관련 파라미터 제거가 적절합니다.

생성자에서 카테고리 파라미터를 제거한 것이 새로운 DB 테이블 구조와 일치합니다.


98-112: 정적 팩토리 메서드 변경이 적절합니다.

of() 메서드에서 카테고리 파라미터를 제거한 것이 새로운 아키텍처와 일치합니다.


115-134: update 메서드 시그니처 변경이 적절합니다.

카테고리 업데이트가 이제 별도의 서비스 메서드를 통해 처리되므로 적절한 변경입니다.

src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java (3)

3-3: 카테고리 타입 변경이 적절합니다.

카테고리를 List<String>으로 변경한 것이 새로운 엔티티 기반 구조와 일치합니다.

Also applies to: 60-60, 157-157


180-194: from() 메서드의 카테고리 변환 로직이 적절합니다.

Category 엔티티에서 코드와 한국어 이름을 추출하여 문자열 리스트로 변환하는 로직이 잘 구현되었습니다.


200-212: update() 메서드의 카테고리 처리가 적절합니다.

카테고리 업데이트 시 엔티티를 문자열로 변환하는 로직이 올바르게 구현되었습니다.

src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java (2)

36-48: 문제 생성 응답 변경이 적절합니다.

void 반환과 201 상태 코드 사용이 RESTful 원칙에 맞습니다.


50-62: 문제 수정 응답 변경이 적절합니다.

void 반환과 200 상태 코드 사용이 적절합니다.

src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java (2)

43-47: 카테고리 생성 메서드가 적절히 구현되었습니다.

트랜잭션 처리와 도메인 서비스 위임이 올바르게 구현되었습니다.


104-105: 문제 수정 시 카테고리 업데이트가 적절히 처리됩니다.

카테고리 업데이트를 별도로 처리하는 것이 관심사 분리 원칙에 맞습니다.

src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java (3)

34-37: 카테고리 생성 메서드가 적절히 구현되었습니다.

간단하고 명확한 구현입니다.


39-44: 문제별 카테고리 조회 메서드가 잘 구현되었습니다.

스트림을 사용한 변환 로직이 깔끔합니다.


53-64: 카테고리 업데이트 로직이 적절히 구현되었습니다.

기존 연결을 삭제하고 새로 생성하는 방식이 명확하고 안전합니다.

Comment on lines +5 to +7
class GameManagementDomainServiceTest {

} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

빈 테스트 클래스는 의미 없는 커밋 노이즈입니다
실제 테스트 메서드가 없으면 테스트 스위트 실행 시 아무 것도 검증하지 못합니다. 최소한 @Disabled 와 TODO 주석을 추가하거나, 구현될 때까지 파일을 커밋에서 제외하세요.

-class GameManagementDomainServiceTest {
-
-}
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+@Disabled("추후 GameManagementDomainService 테스트 구현 예정")
+@DisplayName("GameManagementDomainService 테스트 (미구현)")
+class GameManagementDomainServiceTest {
+
+  @Test
+  void placeholder() {
+    // TODO: 테스트 시나리오 작성
+  }
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class GameManagementDomainServiceTest {
}
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@Disabled("추후 GameManagementDomainService 테스트 구현 예정")
@DisplayName("GameManagementDomainService 테스트 (미구현)")
class GameManagementDomainServiceTest {
@Test
void placeholder() {
// TODO: 테스트 시나리오 작성
}
}
🤖 Prompt for AI Agents
In
src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.java
at lines 5 to 7, the test class is empty and does not contain any test methods,
which adds meaningless noise to commits. To fix this, either add the @Disabled
annotation with a TODO comment indicating that tests will be implemented later,
or remove this file from the commit until actual test methods are added.

Comment on lines +5 to +7
class CharacterStatusDomainServiceTest {

} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

테스트 스텁만 존재하며 검증 로직이 없음
CI 통과 목적의 빈 클래스 커밋은 이후 잊혀지기 쉽습니다. 구현 계획이 없다면 파일을 제거하거나 @Disabled 추가로 의도를 명확히 해 주세요.

-class CharacterStatusDomainServiceTest {
-
-}
+import org.junit.jupiter.api.Disabled;
+
+@Disabled("CharacterStatusDomainService 테스트 구현 예정")
+class CharacterStatusDomainServiceTest {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class CharacterStatusDomainServiceTest {
}
import org.junit.jupiter.api.Disabled;
@Disabled("CharacterStatusDomainService 테스트 구현 예정")
class CharacterStatusDomainServiceTest {}
🤖 Prompt for AI Agents
In
src/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java
at lines 5 to 7, the test class is empty without any verification logic, which
can cause confusion about its purpose. Either remove this empty test class if
there is no implementation plan, or add the @Disabled annotation to clearly
indicate that the test is intentionally inactive.

Comment on lines +5 to +7
class GamePlayUseCaseTest {

} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

빈 테스트 클래스 커밋 지양
GamePlayUseCase 는 변경이 잦은 핵심 로직입니다. 빠르게 최소 happy-path 테스트를 작성해 회귀를 방지하세요.

-class GamePlayUseCaseTest {
-
-}
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class GamePlayUseCaseTest {
+
+  @Test
+  @DisplayName("플레이 진행 시 정상적으로 BattleLog 가 반환된다")
+  void play_returnsBattleLog() {
+    // TODO: GamePlayUseCase mock & 검증 로직 구현
+  }
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class GamePlayUseCaseTest {
}
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class GamePlayUseCaseTest {
@Test
@DisplayName("플레이 진행 시 정상적으로 BattleLog 가 반환된다")
void play_returnsBattleLog() {
// TODO: GamePlayUseCase mock & 검증 로직 구현
}
}
🤖 Prompt for AI Agents
In
src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java
around lines 5 to 7, the test class is empty which risks regressions in the
frequently changed core logic of GamePlayUseCase. Add at least a minimal
happy-path test case that verifies the main functionality to ensure basic
correctness and prevent regressions.

Comment on lines +5 to +7
class GameShopDomainServiceTest {

} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

구현되지 않은 테스트 클래스
Shop 로직은 재고/골드 계산 오류 가능성이 높으므로, 적어도 구매 성공/실패 시나리오에 대한 단위 테스트를 작성하세요.

🤖 Prompt for AI Agents
In
src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.java
around lines 5 to 7, the test class is empty and lacks any unit tests. Implement
unit tests for the Shop logic focusing on at least the purchase success and
failure scenarios to verify correct inventory and gold calculations. Create test
methods that simulate these scenarios and assert expected outcomes to ensure the
domain service behaves correctly.

Comment on lines +5 to +7
class GameAdminUseCaseTest {

} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

빈 테스트 클래스
어드민용 UseCase 는 권한/검증 로직이 많습니다. 최소한 실패 케이스를 포함한 권한 테스트를 작성하여 보안을 확보하세요.

🤖 Prompt for AI Agents
In
src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.java
at lines 5 to 7, the test class is empty. Add test methods that cover
authorization and validation logic, especially focusing on failure cases to
ensure security. Implement tests that verify the admin use case correctly
enforces permission checks and handles invalid inputs or unauthorized access
attempts.

Comment on lines 129 to 135
List<Category> categories = problemDomainService.getProblemCategoryList(problemInfo.problem());

List<String> categoriesName = categories.stream().map(Category::getCategoryKorName).toList();

SubmissionResult submissionResult = submissionDomainService.finalizeSubmission(
submissionData, context.aggregator(), context.getPassedCount(), categoriesName
);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

카테고리 이름 변환 시 null 안전성 검증 필요

카테고리를 한국어 이름으로 변환하는 과정에서 Category::getCategoryKorName 메서드가 null을 반환할 경우를 처리해야 합니다.

-List<String> categoriesName = categories.stream().map(Category::getCategoryKorName).toList();
+List<String> categoriesName = categories.stream()
+    .map(Category::getCategoryKorName)
+    .filter(Objects::nonNull)
+    .toList();

또는 Optional을 사용하여 더 안전하게 처리할 수 있습니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
List<Category> categories = problemDomainService.getProblemCategoryList(problemInfo.problem());
List<String> categoriesName = categories.stream().map(Category::getCategoryKorName).toList();
SubmissionResult submissionResult = submissionDomainService.finalizeSubmission(
submissionData, context.aggregator(), context.getPassedCount(), categoriesName
);
List<Category> categories = problemDomainService.getProblemCategoryList(problemInfo.problem());
List<String> categoriesName = categories.stream()
.map(Category::getCategoryKorName)
.filter(Objects::nonNull)
.toList();
SubmissionResult submissionResult = submissionDomainService.finalizeSubmission(
submissionData, context.aggregator(), context.getPassedCount(), categoriesName
);
🤖 Prompt for AI Agents
In
src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java
around lines 129 to 135, the code maps categories to their Korean names without
null safety, which can cause issues if getCategoryKorName returns null. Update
the stream mapping to filter out null values or use Optional to safely handle
potential nulls before collecting to the list, ensuring categoriesName contains
only non-null strings.

.categories(problem.getCategories())
.title(problem.getTitle())
.description(problem.getDescription())
.categories(categories.stream().map(Category::getCategoryKorName).toList())
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

카테고리 이름 변환 시 null 안전성 보장 필요

Category::getCategoryKorName 호출 시 null 값에 대한 처리가 필요합니다.

-.categories(categories.stream().map(Category::getCategoryKorName).toList())
+.categories(categories.stream()
+    .map(Category::getCategoryKorName)
+    .filter(Objects::nonNull)
+    .collect(Collectors.toList()))
🤖 Prompt for AI Agents
In
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java
at line 62, the mapping of categories to their Korean names using
Category::getCategoryKorName lacks null safety. Modify the stream mapping to
handle potential null values safely, for example by filtering out null
categories or using a conditional mapping that returns a default or empty string
when getCategoryKorName returns null, ensuring no NullPointerException occurs
during the transformation.

@NotNull(message = "카테고리를 설정해야 합니다.")
@Schema(description = "카테고리", example = "FOR_BEGINNER")
List<Category> categories,
@NotNull(message = "카테고리 이름를 설정해야 합니다.")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

유효성 검사 메시지의 문법 오류를 수정하세요.

메시지에서 "카테고리 이름를"은 문법적으로 올바르지 않습니다. "카테고리 이름을"로 수정해야 합니다.

-	@NotNull(message = "카테고리 이름를 설정해야 합니다.")
+	@NotNull(message = "카테고리 이름을 설정해야 합니다.")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@NotNull(message = "카테고리 이름를 설정해야 합니다.")
@NotNull(message = "카테고리 이름을 설정해야 합니다.")
🤖 Prompt for AI Agents
In
src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java
at line 16, the validation message contains a grammatical error in Korean: "카테고리
이름를" should be corrected to "카테고리 이름을". Update the message string in the
@NotNull annotation to fix this grammar mistake.

Comment on lines +76 to +84
@PostMapping("/categories")
public ResponseEntity<Void> createCategory(@RequestBody CategoryCreateRequest request) {

problemService.createCategory(request);

return ResponseEntity
.status(HttpStatus.CREATED)
.build();
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

카테고리 생성 엔드포인트에 API 문서화가 필요합니다.

새로운 카테고리 생성 엔드포인트에 Swagger 어노테이션이 누락되었습니다.

+@Operation(summary = "카테고리 생성", description = "새로운 카테고리를 생성합니다.")
+@ApiResponse(responseCode = "201", description = "카테고리 생성 성공")
 @PostMapping("/categories")
 public ResponseEntity<Void> createCategory(@RequestBody CategoryCreateRequest request) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@PostMapping("/categories")
public ResponseEntity<Void> createCategory(@RequestBody CategoryCreateRequest request) {
problemService.createCategory(request);
return ResponseEntity
.status(HttpStatus.CREATED)
.build();
}
@Operation(summary = "카테고리 생성", description = "새로운 카테고리를 생성합니다.")
@ApiResponse(responseCode = "201", description = "카테고리 생성 성공")
@PostMapping("/categories")
public ResponseEntity<Void> createCategory(@RequestBody CategoryCreateRequest request) {
problemService.createCategory(request);
return ResponseEntity
.status(HttpStatus.CREATED)
.build();
}
🤖 Prompt for AI Agents
In
src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java
around lines 76 to 84, the createCategory endpoint lacks Swagger API
documentation annotations. Add appropriate Swagger annotations such as
@Operation to describe the endpoint's purpose, and @ApiResponse to document
possible HTTP responses, ensuring the API is properly documented for consumers.

@chat26666 chat26666 self-assigned this Jun 26, 2025
@chat26666 chat26666 added Test bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested labels Jun 26, 2025
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

🧹 Nitpick comments (2)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java (1)

16-16: 필드명의 일관성을 개선해주세요.

필드명 statCategoryJRepository가 일관성이 없습니다. 클래스명과 일치하도록 명명하는 것이 좋겠습니다.

-	private final CategoryStatJpaRepository statCategoryJRepository;
+	private final CategoryStatJpaRepository categoryStatJpaRepository;

그리고 해당하는 메서드 호출들도 함께 수정해주세요.

src/main/java/org/ezcode/codetest/domain/game/util/StatUpdateUtil.java (1)

25-31: ```shell
#!/bin/bash

Searching for findByCategoryName and findByCategoryKorName definitions across the codebase

echo "=== findByCategoryName ==="
rg -A5 "findByCategoryName" --type java

echo
echo "=== findByCategoryKorName ==="
rg -A5 "findByCategoryKorName" --type java


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

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


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 189e2d76c2e19710a21541b451cc8c205266d2db and 0cd2d2592ec42f263d0d68d6400cda7442e7241d.

</details>

<details>
<summary>📒 Files selected for processing (53)</summary>

* `src/main/java/org/ezcode/codetest/application/problem/dto/request/CategoryCreateRequest.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java` (4 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java` (3 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java` (4 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemSearchResponse.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/service/ProblemSearchService.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java` (4 hunks)
* `src/main/java/org/ezcode/codetest/application/submission/model/SubmissionContext.java` (2 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/exception/GameExceptionCode.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/model/character/CategoryStat.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/model/character/CharacterRealStat.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/repository/CategoryStatRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainService.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/game/util/StatUpdateUtil.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/ProblemInfo.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/ProblemSearchCondition.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java` (3 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java` (5 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/model/enums/Category.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/repository/CategoryRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/repository/ProblemCategoryRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java` (3 hunks)
* `src/main/java/org/ezcode/codetest/domain/studygroup/model/StudyGroupUser.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/domain/studygroup/service/StudyGroupDomainService.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/domain/submission/model/SubmissionResult.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/domain/submission/model/entity/UserProblemResult.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/cache/config/CaffeineCacheConfig.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java` (4 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatJpaRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryJpaRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryJpaRepository.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java` (1 hunks)
* `src/main/java/org/ezcode/codetest/presentation/game/play/TestGamePlayController.java` (0 hunks)
* `src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java` (3 hunks)
* `src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java` (1 hunks)
* `src/main/resources/application.properties` (2 hunks)
* `src/main/resources/elasticsearch/my_index-settings.json` (1 hunks)
* `src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainServiceTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.java` (1 hunks)
* `src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.java` (1 hunks)
* `src/test/resources/application-test.properties` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (6)</summary>

* src/main/java/org/ezcode/codetest/application/problem/service/ProblemSearchService.java
* src/main/java/org/ezcode/codetest/domain/submission/model/entity/UserProblemResult.java
* src/main/java/org/ezcode/codetest/domain/studygroup/service/StudyGroupDomainService.java
* src/main/java/org/ezcode/codetest/domain/problem/model/enums/Category.java
* src/main/java/org/ezcode/codetest/presentation/game/play/TestGamePlayController.java
* src/main/java/org/ezcode/codetest/domain/studygroup/model/StudyGroupUser.java

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (5)</summary>

* src/main/java/org/ezcode/codetest/infrastructure/cache/config/CaffeineCacheConfig.java
* src/test/java/org/ezcode/codetest/application/game/management/GameAdminUseCaseTest.java
* src/test/java/org/ezcode/codetest/domain/game/service/GameEncounterDomainServiceTest.java
* src/main/java/org/ezcode/codetest/domain/game/exception/GameExceptionCode.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatJpaRepository.java

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (34)</summary>

* src/main/resources/elasticsearch/my_index-settings.json
* src/test/java/org/ezcode/codetest/domain/game/service/GameShopDomainServiceTest.java
* src/test/resources/application-test.properties
* src/test/java/org/ezcode/codetest/application/game/play/GamePlayUseCaseTest.java
* src/test/java/org/ezcode/codetest/domain/game/service/GameManagementDomainServiceTest.java
* src/test/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainServiceTest.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java
* src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemSearchResponse.java
* src/main/java/org/ezcode/codetest/domain/submission/service/SubmissionDomainService.java
* src/main/java/org/ezcode/codetest/domain/problem/model/ProblemSearchCondition.java
* src/main/java/org/ezcode/codetest/application/problem/dto/request/CategoryCreateRequest.java
* src/main/java/org/ezcode/codetest/domain/submission/model/SubmissionResult.java
* src/main/resources/application.properties
* src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDslImpl.java
* src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemController.java
* src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchAdapter.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryJpaRepository.java
* src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java
* src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java
* src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemCategory.java
* src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java
* src/main/java/org/ezcode/codetest/domain/problem/repository/CategoryRepository.java
* src/main/java/org/ezcode/codetest/domain/problem/model/entity/Category.java
* src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryJpaRepository.java
* src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java
* src/test/java/org/ezcode/codetest/domain/game/service/CharacterEquipServiceTest.java
* src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemCategoryRepositoryImpl.java
* src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemSearchDocument.java
* src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java
* src/main/java/org/ezcode/codetest/domain/problem/repository/ProblemCategoryRepository.java
* src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemAdminController.java
* src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (6)</summary>

<details>
<summary>📓 Common learnings</summary>

Learnt from: chat26666
PR: #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: #36
File: src/main/java/org/ezcode/codetest/domain/problem/model/entity/ProblemLanguage.java:3-3
Timestamp: 2025-06-06T07:57:51.226Z
Learning: 사용자 thezz9는 Language 엔티티를 Submission 도메인으로 이동시킨 이유가 "제출하려면 필요해서"라고 설명했으며, Problem 도메인과 Submission 도메인 간의 종속성 위반 문제에 대한 해결 방안을 고민하고 있다.


Learnt from: Kimminu7
PR: #63
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/ProblemQueryRepositoryImpl.java:24-40
Timestamp: 2025-06-14T14:33:58.372Z
Learning: ProblemController에서 ProblemSearchCondition 객체는 항상 new ProblemSearchCondition(category, difficulty)로 유효한 인스턴스를 생성해서 전달하므로, ProblemQueryRepositoryImpl의 searchByCondition 메서드에서 searchCondition 파라미터 자체에 대한 null 체크는 불필요하다. category와 difficulty 필드만 각각 null일 수 있다.


</details>
<details>
<summary>src/main/java/org/ezcode/codetest/domain/game/model/character/CharacterRealStat.java (1)</summary>

Learnt from: chat26666
PR: #67
File: src/main/java/org/ezcode/codetest/domain/game/strategy/SkillStrategyImpl/CounterAttackSkill.java:21-29
Timestamp: 2025-06-17T14:54:35.657Z
Learning: The playerDamaged() method in CharacterContext internally handles defense calculation, so skill implementations should pass raw damage values to this method rather than pre-calculated damage after defense.


</details>
<details>
<summary>src/main/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainService.java (2)</summary>

Learnt from: chat26666
PR: #67
File: src/main/java/org/ezcode/codetest/application/game/play/GamePlayUseCase.java:117-124
Timestamp: 2025-06-16T17:19:46.167Z
Learning: In GamePlayUseCase.java, the user temporarily returns BattleLog domain object directly for testing/verification purposes with plans to convert to DTO later during development.


Learnt from: chat26666
PR: #67
File: src/main/java/org/ezcode/codetest/domain/game/strategy/SkillStrategyImpl/CounterAttackSkill.java:21-29
Timestamp: 2025-06-17T14:54:35.657Z
Learning: The playerDamaged() method in CharacterContext internally handles defense calculation, so skill implementations should pass raw damage values to this method rather than pre-calculated damage after defense.


</details>
<details>
<summary>src/main/java/org/ezcode/codetest/domain/game/repository/CategoryStatRepository.java (1)</summary>

Learnt from: chat26666
PR: #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.


</details>
<details>
<summary>src/main/java/org/ezcode/codetest/application/submission/model/SubmissionContext.java (1)</summary>

Learnt from: thezz9
PR: #36
File: src/main/java/org/ezcode/codetest/domain/submission/dto/SubmissionData.java:47-58
Timestamp: 2025-06-06T07:59:41.806Z
Learning: SubmissionData.withAggregatedStats() 메서드에서 testCaseList는 상위 프로세스(base() 메서드의 problemInfo.testcaseList())에서 이미 null 체크가 처리되어 오므로 추가적인 null 체크가 불필요함


</details>
<details>
<summary>src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java (2)</summary>

Learnt from: chat26666
PR: #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: #67
File: src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/skill/GameCharacterSkillJpaRepository.java:15-17
Timestamp: 2025-06-17T14:46:51.206Z
Learning: GameCharacterSkillJpaRepository에서 findByCharacterId 메서드는 skill 참조를 하지 않기 때문에 @entitygraph를 사용하지 않는다. 실제 사용 패턴에 따라 선택적으로 eager loading을 적용하는 것이 성능상 더 효율적이다.


</details>

</details><details>
<summary>🧬 Code Graph Analysis (2)</summary>

<details>
<summary>src/main/java/org/ezcode/codetest/domain/game/util/StatUpdateUtil.java (1)</summary><blockquote>

<details>
<summary>src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java (1)</summary>

* `RequiredArgsConstructor` (12-37)

</details>

</blockquote></details>
<details>
<summary>src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java (1)</summary><blockquote>

<details>
<summary>src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/problem/CategoryRepositoryImpl.java (1)</summary>

* `Repository` (12-36)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (11)</summary><blockquote>

<details>
<summary>src/main/java/org/ezcode/codetest/domain/problem/model/ProblemInfo.java (2)</summary>

`5-5`: **Category 엔티티 import 추가 승인**

enum 기반에서 엔티티 기반 카테고리 시스템으로의 전환을 위한 적절한 import 추가입니다.

---

`15-15`: **problemCategories 필드 추가 승인**

문제와 카테고리 간의 다대다 관계를 명확히 표현하는 적절한 필드 추가입니다. `List<Category>` 타입으로 여러 카테고리를 담을 수 있도록 설계되었습니다.

</details>
<details>
<summary>src/main/java/org/ezcode/codetest/application/submission/model/SubmissionContext.java (2)</summary>

`6-6`: **Category 엔티티 import 추가 승인**

새로운 엔티티 기반 카테고리 시스템을 지원하기 위한 적절한 import 추가입니다.

---

`130-132`: **getProblemCategories() 메서드의 null safety 검증 필요**

메서드 로직은 올바르지만 null safety 처리를 확인해야 합니다. `problemInfo.problemCategories()`, 개별 `Category` 객체, 그리고 `Category.getKorName()` 반환값에 대한 null 처리가 상위 프로세스에서 보장되는지 검증이 필요합니다.



다음 스크립트로 null safety 처리 현황을 확인해주세요:

```shell
#!/bin/bash
# ProblemInfo의 problemCategories 필드와 Category.getKorName() 메서드의 null 처리 확인

# ProblemInfo에서 problemCategories 필드 초기화 방식 확인
ast-grep --pattern 'class ProblemInfo {
  $$$
  problemCategories
  $$$
}'

# Category 엔티티의 getKorName() 메서드 구현 확인
ast-grep --pattern 'class Category {
  $$$
  getKorName() {
    $$$
  }
  $$$
}'

# ProblemDomainService에서 problemCategories 설정 방식 확인
rg -A 10 "problemCategories.*=" --type java
src/main/java/org/ezcode/codetest/domain/game/model/character/CategoryStat.java (1)

42-50: ElementCollection 매핑 구성이 적절합니다.

EnumMap을 사용한 Stat 매핑과 ElementCollection 설정이 올바르게 구성되어 있습니다. LAZY 페치 타입도 성능상 적절한 선택입니다.

src/main/java/org/ezcode/codetest/domain/game/model/character/CharacterRealStat.java (1)

97-100: 디버깅 스탯 밸런싱 조정이 적절합니다.

DEBUGGING 케이스에서 치명타 증가율을 감소시키고 공격력 증가를 추가한 밸런싱 변경이 합리적으로 보입니다.

src/main/java/org/ezcode/codetest/domain/game/service/CharacterStatusDomainService.java (1)

67-67: 카테고리 기반 스탯 증가 로직으로의 전환이 적절합니다.

메서드명 변경이 새로운 카테고리 엔티티 기반 접근법과 일관성을 유지하고 있습니다.

src/main/java/org/ezcode/codetest/domain/game/repository/CategoryStatRepository.java (1)

7-14: 리포지토리 인터페이스 설계가 적절합니다.

표준적인 리포지토리 패턴을 잘 따르고 있으며, ID와 이름 기반 조회 메서드가 적절하게 제공되고 있습니다.

src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatRepositoryImpl.java (1)

31-35: 아래 스크립트로 CategoryStatJpaRepository 인터페이스에 findByCategoryKorName 메서드가 실제로 정의되어 있는지 확인해주세요.

#!/bin/bash
FILE="src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/game/mysql/character/CategoryStatJpaRepository.java"

if [ -f "$FILE" ]; then
  echo "---- 인터페이스 상단 (1~200행) ----"
  sed -n '1,200p' "$FILE"
  echo ""
  echo "---- findByCategoryKorName 메서드 검색 ----"
  grep -n "findByCategoryKorName" "$FILE" || echo ">> 메서드가 정의되어 있지 않습니다."
else
  echo "ERROR: $FILE 파일을 찾을 수 없습니다."
fi
src/main/java/org/ezcode/codetest/domain/game/util/StatUpdateUtil.java (2)

5-19: Spring 컴포넌트 변환이 적절합니다.

정적 유틸리티 클래스에서 Spring 관리 컴포넌트로의 전환이 잘 이루어졌습니다. 의존성 주입 설정이 올바르게 구성되었습니다.


1-33: 데이터베이스 기반으로의 전환이 잘 이루어졌습니다.

정적 맵에서 데이터베이스 기반 저장소로의 전환이 성공적으로 완료되었습니다. 캐싱을 통해 성능 영향을 최소화하고, 적절한 예외 처리로 견고성을 확보했습니다.

Comment on lines +52 to +61
public CategoryStat(Category category) {

this.category = category;

for (Stat stat : Stat.values()) {
double randomValue = ThreadLocalRandom.current()
.nextDouble(0.5, 2.0);
stats.put(stat, randomValue);
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

생성자에서 비즈니스 로직 분리를 고려해보세요.

엔티티 생성자에서 랜덤 값을 생성하는 비즈니스 로직이 포함되어 있습니다. 이는 다음과 같은 문제를 야기할 수 있습니다:

  • 테스트가 어려움 (예측 불가능한 랜덤 값)
  • 엔티티의 단일 책임 원칙 위반
  • 도메인 서비스나 팩토리에서 처리하는 것이 더 적절함

다음과 같이 분리하는 것을 고려해보세요:

-	public CategoryStat(Category category) {
-
-		this.category = category;
-
-		for (Stat stat : Stat.values()) {
-			double randomValue = ThreadLocalRandom.current()
-				.nextDouble(0.5, 2.0);
-			stats.put(stat, randomValue);
-		}
-	}
+	public CategoryStat(Category category, Map<Stat, Double> initialStats) {
+		this.category = category;
+		this.stats.putAll(initialStats);
+	}
+
+	public CategoryStat(Category category) {
+		this.category = category;
+	}
🤖 Prompt for AI Agents
In
src/main/java/org/ezcode/codetest/domain/game/model/character/CategoryStat.java
around lines 52 to 61, the constructor includes business logic generating random
values, which violates single responsibility and complicates testing. Refactor
by removing the random value generation from the constructor and instead move
this logic to a domain service or factory class responsible for creating
CategoryStat instances with initialized stats. The constructor should only
assign passed-in values without performing randomization.

Comment on lines +20 to 23
public CategoryStat save(CategoryStat categoryStat) {

Map<String, StatIncreasePerProblem> modifiableMap = new HashMap<>();

StatIncreasePerProblem implStat = new StatIncreasePerProblem();
implStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
implStat.putIncreaseStat(Stat.DEBUGGING, 0.7);
modifiableMap.put("구현", implStat);

StatIncreasePerProblem greedyStat = new StatIncreasePerProblem();
greedyStat.putIncreaseStat(Stat.OPTIMIZATION, 1.2);
greedyStat.putIncreaseStat(Stat.SPEED, 0.8);
modifiableMap.put("그리디 알고리즘", greedyStat);

StatIncreasePerProblem dfsStat = new StatIncreasePerProblem();
dfsStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.9);
dfsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.1);
modifiableMap.put("깊이 우선 탐색", dfsStat);

StatIncreasePerProblem bfsStat = new StatIncreasePerProblem();
bfsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.0);
bfsStat.putIncreaseStat(Stat.SPEED, 0.7);
modifiableMap.put("넓이 우선 탐색", bfsStat);

StatIncreasePerProblem dpStat = new StatIncreasePerProblem();
dpStat.putIncreaseStat(Stat.OPTIMIZATION, 1.3);
dpStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
modifiableMap.put("동적 계획법", dpStat);

StatIncreasePerProblem graphStat = new StatIncreasePerProblem();
graphStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.2);
graphStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
modifiableMap.put("그래프 이론", graphStat);

StatIncreasePerProblem treeStat = new StatIncreasePerProblem();
treeStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.1);
treeStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.7);
modifiableMap.put("트리", treeStat);

StatIncreasePerProblem dsStat = new StatIncreasePerProblem();
dsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.5);
modifiableMap.put("자료구조(스택, 힙, 큐)", dsStat);

StatIncreasePerProblem stringStat = new StatIncreasePerProblem();
stringStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
stringStat.putIncreaseStat(Stat.DEBUGGING, 0.6);
modifiableMap.put("문자열", stringStat);

StatIncreasePerProblem mathStat = new StatIncreasePerProblem();
mathStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.2);
mathStat.putIncreaseStat(Stat.OPTIMIZATION, 0.7);
modifiableMap.put("수학", mathStat);

StatIncreasePerProblem simStat = new StatIncreasePerProblem();
simStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.9);
simStat.putIncreaseStat(Stat.OPTIMIZATION, 0.9);
modifiableMap.put("시뮬레이션", simStat);

StatIncreasePerProblem bitwiseStat = new StatIncreasePerProblem();
bitwiseStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
bitwiseStat.putIncreaseStat(Stat.OPTIMIZATION, 0.8);
modifiableMap.put("비트 연산", bitwiseStat);

StatIncreasePerProblem recursionStat = new StatIncreasePerProblem();
recursionStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.1);
modifiableMap.put("재귀", recursionStat);

StatIncreasePerProblem backtrackStat = new StatIncreasePerProblem();
backtrackStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
backtrackStat.putIncreaseStat(Stat.DEBUGGING, 0.5);
modifiableMap.put("백트래킹", backtrackStat);

StatIncreasePerProblem interviewStat = new StatIncreasePerProblem();
interviewStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.7);
interviewStat.putIncreaseStat(Stat.DEBUGGING, 0.7);
modifiableMap.put("면접 대비", interviewStat);

StatIncreasePerProblem mcqStat = new StatIncreasePerProblem();
mcqStat.putIncreaseStat(Stat.SPEED, 0.6);
mcqStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.4);
modifiableMap.put("객관식 문제", mcqStat);

StatIncreasePerProblem fillBlankStat = new StatIncreasePerProblem();
fillBlankStat.putIncreaseStat(Stat.DATA_STRUCTURE, 0.7);
fillBlankStat.putIncreaseStat(Stat.SPEED, 0.5);
modifiableMap.put("빈칸 문제", fillBlankStat);

StatIncreasePerProblem beginnerStat = new StatIncreasePerProblem();
beginnerStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
beginnerStat.putIncreaseStat(Stat.DEBUGGING, 0.8);
modifiableMap.put("입문자용", beginnerStat);

this.increasedStatRate = Collections.unmodifiableMap(modifiableMap);
return categoryStatRepository.save(categoryStat);
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

파라미터 검증 추가를 고려하세요.

categoryStat 파라미터에 대한 null 체크를 추가하여 NPE를 방지하는 것이 좋겠습니다.

 public CategoryStat save(CategoryStat categoryStat) {
+    if (categoryStat == null) {
+        throw new IllegalArgumentException("CategoryStat cannot be null");
+    }
 
     return categoryStatRepository.save(categoryStat);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public CategoryStat save(CategoryStat categoryStat) {
Map<String, StatIncreasePerProblem> modifiableMap = new HashMap<>();
StatIncreasePerProblem implStat = new StatIncreasePerProblem();
implStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
implStat.putIncreaseStat(Stat.DEBUGGING, 0.7);
modifiableMap.put("구현", implStat);
StatIncreasePerProblem greedyStat = new StatIncreasePerProblem();
greedyStat.putIncreaseStat(Stat.OPTIMIZATION, 1.2);
greedyStat.putIncreaseStat(Stat.SPEED, 0.8);
modifiableMap.put("그리디 알고리즘", greedyStat);
StatIncreasePerProblem dfsStat = new StatIncreasePerProblem();
dfsStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.9);
dfsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.1);
modifiableMap.put("깊이 우선 탐색", dfsStat);
StatIncreasePerProblem bfsStat = new StatIncreasePerProblem();
bfsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.0);
bfsStat.putIncreaseStat(Stat.SPEED, 0.7);
modifiableMap.put("넓이 우선 탐색", bfsStat);
StatIncreasePerProblem dpStat = new StatIncreasePerProblem();
dpStat.putIncreaseStat(Stat.OPTIMIZATION, 1.3);
dpStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
modifiableMap.put("동적 계획법", dpStat);
StatIncreasePerProblem graphStat = new StatIncreasePerProblem();
graphStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.2);
graphStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
modifiableMap.put("그래프 이론", graphStat);
StatIncreasePerProblem treeStat = new StatIncreasePerProblem();
treeStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.1);
treeStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.7);
modifiableMap.put("트리", treeStat);
StatIncreasePerProblem dsStat = new StatIncreasePerProblem();
dsStat.putIncreaseStat(Stat.DATA_STRUCTURE, 1.5);
modifiableMap.put("자료구조(스택, 힙, 큐)", dsStat);
StatIncreasePerProblem stringStat = new StatIncreasePerProblem();
stringStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
stringStat.putIncreaseStat(Stat.DEBUGGING, 0.6);
modifiableMap.put("문자열", stringStat);
StatIncreasePerProblem mathStat = new StatIncreasePerProblem();
mathStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.2);
mathStat.putIncreaseStat(Stat.OPTIMIZATION, 0.7);
modifiableMap.put("수학", mathStat);
StatIncreasePerProblem simStat = new StatIncreasePerProblem();
simStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.9);
simStat.putIncreaseStat(Stat.OPTIMIZATION, 0.9);
modifiableMap.put("시뮬레이션", simStat);
StatIncreasePerProblem bitwiseStat = new StatIncreasePerProblem();
bitwiseStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
bitwiseStat.putIncreaseStat(Stat.OPTIMIZATION, 0.8);
modifiableMap.put("비트 연산", bitwiseStat);
StatIncreasePerProblem recursionStat = new StatIncreasePerProblem();
recursionStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.1);
modifiableMap.put("재귀", recursionStat);
StatIncreasePerProblem backtrackStat = new StatIncreasePerProblem();
backtrackStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 1.0);
backtrackStat.putIncreaseStat(Stat.DEBUGGING, 0.5);
modifiableMap.put("백트래킹", backtrackStat);
StatIncreasePerProblem interviewStat = new StatIncreasePerProblem();
interviewStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.7);
interviewStat.putIncreaseStat(Stat.DEBUGGING, 0.7);
modifiableMap.put("면접 대비", interviewStat);
StatIncreasePerProblem mcqStat = new StatIncreasePerProblem();
mcqStat.putIncreaseStat(Stat.SPEED, 0.6);
mcqStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.4);
modifiableMap.put("객관식 문제", mcqStat);
StatIncreasePerProblem fillBlankStat = new StatIncreasePerProblem();
fillBlankStat.putIncreaseStat(Stat.DATA_STRUCTURE, 0.7);
fillBlankStat.putIncreaseStat(Stat.SPEED, 0.5);
modifiableMap.put("빈칸 문제", fillBlankStat);
StatIncreasePerProblem beginnerStat = new StatIncreasePerProblem();
beginnerStat.putIncreaseStat(Stat.PROBLEM_SOLVING, 0.8);
beginnerStat.putIncreaseStat(Stat.DEBUGGING, 0.8);
modifiableMap.put("입문자용", beginnerStat);
this.increasedStatRate = Collections.unmodifiableMap(modifiableMap);
return categoryStatRepository.save(categoryStat);
}
public CategoryStat save(CategoryStat categoryStat) {
if (categoryStat == null) {
throw new IllegalArgumentException("CategoryStat cannot be null");
}
return categoryStatRepository.save(categoryStat);
}
🤖 Prompt for AI Agents
In src/main/java/org/ezcode/codetest/domain/game/util/StatUpdateUtil.java
between lines 20 and 23, add a null check for the categoryStat parameter at the
start of the save method to prevent NullPointerException. If categoryStat is
null, handle it appropriately, for example by throwing an
IllegalArgumentException or returning early, before calling
categoryStatRepository.save.

Copy link
Contributor

@pokerbearkr pokerbearkr left a comment

Choose a reason for hiding this comment

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

태그가 산더미처럼 달려있네요

@chat26666
Copy link
Collaborator Author

chat26666 commented Jun 26, 2025

태그가 산더미처럼 달려있네요

갑자기 갈아 엎으려니까 너무 즐거워서 태그를 많이 달아버렸네요

@chat26666 chat26666 removed duplicate This issue or pull request already exists good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right labels Jun 26, 2025
@chat26666 chat26666 merged commit a822b60 into dev Jun 27, 2025
2 checks passed
@chat26666 chat26666 deleted the test/game branch June 27, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested Test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants