Skip to content

[Joonseok] Week4 미션#14

Open
Joonseok-Lee wants to merge 3 commits intoJoonseokfrom
Joonseok-Week4
Open

[Joonseok] Week4 미션#14
Joonseok-Lee wants to merge 3 commits intoJoonseokfrom
Joonseok-Week4

Conversation

@Joonseok-Lee
Copy link
Copy Markdown

🔗 연관 이슈

🛠 작업 내용

  • 프로젝트 초기화
  • 도메인형 아키텍처에 맞는 프로젝트 설계
  • Swagger 설정

🖼 스크린샷 (선택)

👀 리뷰 요구사항 (선택)

🤖 AI 활용

  • AI 사용 안 함
  • 코드 작성 아이디어 참고
  • 테스트/리팩토링 보조
  • 문서/주석 작성 보조
  • 기타 (아래에 간단히 작성)

💬 나의 프롬프트

user 패키지를 참조해서 mission, review 패키지 파일도 만들어줘

🧠 AI 응답

(네이밍 컨벤션에 맞게 파일 생성)

✅ 내가 최종 선택한 방법 (이유)

💡 나만의 Tip (선택)

@Joonseok-Lee Joonseok-Lee self-assigned this Apr 6, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2bcd26a75

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 테스트에서 DB 자동구성 실패를 분리하세요

@SpringBootTest는 전체 애플리케이션 컨텍스트를 올리는데, 현재 커밋은 JPA/MySQL 의존성(build.gradle)을 추가했지만 저장소 기준으로 datasource 설정 파일이 없어 테스트 실행 시 DataSource 자동구성이 실패해 contextLoads가 깨집니다. 학습 관점에서도 테스트 의도(컨텍스트 확인 vs DB 통합)가 섞이면 원인 파악이 어려워지므로, src/test/resources에 테스트 프로필(H2 또는 Testcontainers)을 분리하고 @ActiveProfiles("test")를 쓰거나, 목적이 JPA 검증이라면 @DataJpaTest로 범위를 줄이세요. 다음으로는 Spring Boot 자동구성 조건과 테스트 슬라이스 개념을 함께 학습하는 것을 권장합니다.

Useful? React with 👍 / 👎.

@@ -0,0 +1,4 @@
package com.umc.study.domain.user.enums;

public class Term {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 도메인 내 Term 타입명 충돌을 해소하세요

user.entity.Termuser.enums.Term이 같은 이름을 가져서, UserTerm 같은 조합 모델에서 두 타입을 함께 다루는 순간 import 충돌과 의미 혼동이 발생합니다. Spring/JPA 코드에서는 타입명이 곧 도메인 의미를 전달하므로 이런 충돌은 책임 경계를 흐리고 리팩터링 난이도를 높입니다. 엔티티는 PolicyTerm/AgreementTerm처럼 실체를 드러내고, enum은 TermType/AgreementStatus처럼 역할을 드러내게 분리해 주세요. 다음 학습 주제로는 유비쿼터스 언어(DDD 네이밍)와 패키지 경계 설계를 추천합니다.

Useful? React with 👍 / 👎.

@@ -0,0 +1,4 @@
package com.umc.study.domain.user.enums;

public class Gender {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge enum 패키지 타입을 enum으로 선언하세요

enums 패키지의 Genderclass로 두면 값 집합이 열려 있어 도메인 제약(허용 가능한 성별 값 제한)을 타입 시스템으로 강제할 수 없고, 이후 JPA 매핑에서도 @Enumerated 기반의 명확한 모델링이 어려워집니다. Spring/Java 학습에서 enum은 상태 공간을 닫아 도메인 무결성을 지키는 핵심 도구이므로 enum Gender { ... }로 바꾸고 SocialType, Address도 같은 원칙으로 정리해 주세요. 다음으로는 JPA enum 매핑(EnumType.STRING)과 값 객체/열거형 선택 기준을 학습하면 좋습니다.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

추적하지 않아야 할 파일 설정에 도움이 되었습니다!

@LATE-BL00MER
Copy link
Copy Markdown

PR 리뷰 덕분에 문제점을 파악하고 해결에 도움을 얻었습니다. 감사합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants