Skip to content

Conversation

@joyewon0705
Copy link
Collaborator

@joyewon0705 joyewon0705 commented Sep 24, 2025

📌 개요

  • 회원가입 기능 구현 및 관련 테스트 코드 작성
  • UserUserProfile 관계 리팩터링 (1:N → 1:1)

🔨 작업 내용

1. 회원가입 서비스/컨트롤러

  • UserService
    • register 메서드 구현 (중복 검증, 비밀번호 정책 검증, User & UserProfile 저장)
    • 관련 예외 정의 및 처리 (CustomException + ErrorCode)
  • AuthController
    • POST /api/auth/register 회원가입 API 구현
    • 성공 시 201 Created 반환, 실패 시 예외 매핑

2. 테스트 코드

  • UserServiceTest
    • 정상 회원가입 케이스 검증
    • 중복(username/email/nickname) 검증
    • 비밀번호 정책 위반 검증
  • AuthControllerTest
    • 정상 회원가입
    • 중복 username/email/nickname
    • 비밀번호 정책 위반
    • 잘못된 요청값 (필수 필드 누락/형식 위반)

3. 예외 처리

  • GlobalExceptionHandler
    • MethodArgumentNotValidException 처리 (COMMON_400)

4. 엔티티 리팩터링

  • UserUserProfile 관계를 1:N → 1:1로 변경
    • User.userProfiles (List<UserProfile>)User.userProfile (단일 UserProfile)
    • UserProfile에서 @OneToOne 매핑 적용
  • 회원가입 시 UserProfile 자동 생성 및 연관관계 설정

🔗 관련 이슈

Closes #50

📝 참고 사항

✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

@github-actions github-actions bot changed the title Feat: 회원가입 API 구현 Feat: 회원가입 API 구현 (#50) Sep 24, 2025
@KSH0326 KSH0326 self-requested a review September 24, 2025 06:07
@joyewon0705 joyewon0705 merged commit 33c5d40 into dev Sep 24, 2025
5 checks passed
@joyewon0705 joyewon0705 deleted the Feat/50 branch September 24, 2025 07:10
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.

4 participants