Skip to content

#51 [Refactor] User 엔티티 연결 및 전 도메인 TODO 해소#66

Merged
Dante0922 merged 8 commits intodevfrom
refactor/#51-user-entity-todo
Mar 28, 2026
Merged

#51 [Refactor] User 엔티티 연결 및 전 도메인 TODO 해소#66
Dante0922 merged 8 commits intodevfrom
refactor/#51-user-entity-todo

Conversation

@Dante0922
Copy link
Copy Markdown
Contributor

Summary

  • Vote, Perspective, PerspectiveComment, PerspectiveLike, CreditHistory의 Long userId@ManyToOne User 엔티티 관계로 전환
  • Perspective의 Long battleId, Long optionId@ManyToOne Battle, @ManyToOne BattleOption으로 전환
  • 전 도메인 컨트롤러의 Long userId = 1L 하드코딩 → @AuthenticationPrincipal Long userId로 교체 (VoteController, PerspectiveController, PerspectiveCommentController, PerspectiveLikeController)
  • 해소된 TODO 주석 제거 (S3 임시 구현 3건, AdMob 포인트 합산, Prevote 체크)
  • ✨ Feat: Home/MyPage/Search 탭 개선 #64 작업 포함: S3 Presigned URL, 홈 API 섹션별 DTO, 철학자 유형 산출/확장, 탐색 탭 검색 API

Changes (29 files)

  • Entities (5): Vote, Perspective, PerspectiveComment, PerspectiveLike, CreditHistory
  • Repositories (5): VoteRepository, PerspectiveRepository, PerspectiveCommentRepository, PerspectiveLikeRepository, CreditHistoryRepository
  • Services (10): VoteServiceImpl, VoteQueryService, PerspectiveService, PerspectiveCommentService, PerspectiveLikeService, PerspectiveQueryService, CreditService, MypageService, ScenarioServiceImpl, BattleServiceImpl
  • Controllers (5): VoteController, PerspectiveController, PerspectiveCommentController, PerspectiveLikeController, ScenarioController
  • Infra (3): S3Config, S3PresignedUrlService, FileUploadResponse — TODO 제거
  • Tests (2): CreditServiceTest, MypageServiceTest

Test plan

  • ./gradlew compileJava compileTestJava 컴파일 성공
  • CreditServiceTest 5개 통과
  • MypageServiceTest 12개 통과
  • 로컬 Swagger에서 @AuthenticationPrincipal 동작 확인
  • 투표 → 관점 → 좋아요/댓글 플로우 E2E 확인

Closes #51

🤖 Generated with Claude Code

Dante0922 and others added 6 commits March 28, 2026 18:16
S3 버킷 프라이빗 전환에 따라 Presigned URL 기반 파일 접근 방식 도입
- S3Presigner Bean 등록 (S3Config)
- S3PresignedUrlService: presigned GET URL 생성 (기존 풀 URL 하위 호환)
- S3UploadServiceImpl: 업로드 후 S3 키만 반환하도록 변경
- FileUploadController: 응답에 s3Key + presignedUrl 포함
- application.yml: presigned URL 만료 시간 설정 추가 (6시간)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 통합 HomeBattleResponse를 섹션별 전용 DTO로 분리
  (EditorPick, Trending, BestBattle, TodayQuiz, TodayVote, NewBattle)
- 퀴즈(O/X)와 투표(4지선다)를 별도 응답 타입으로 분리
- Best배틀/새로운배틀 철학자 이름을 태그(PHILOSOPHER)에서 추출
- 새로운배틀에 철학자 이미지 URL 추가
- TodayBattleResponse에 퀴즈·투표 전용 필드 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PhilosopherType, CharacterType enum에 label(한글)과 imageKey(S3 경로) 추가
- JSON 직렬화를 enum name(대문자) 통일, 한글은 별도 label 필드로 전달
- CharacterTypeConverter를 enum name 기반으로 변경
- MypageResponse, RecapResponse에 이미지 presigned URL 및 label 필드 추가
- MypageService에 S3PresignedUrlService 연동
- FileCategory에 CHARACTER 카테고리 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PhilosopherType에 typeName, description, bestMatch, worstMatch, 6축 고정 점수 추가
- UserProfile에 philosopherType 필드 추가 (nullable, @Enumerated STRING)
- 최초 5회 투표 기반 PHILOSOPHER 태그 최다 빈도로 철학자 유형 자동 산출 후 저장
- Recap 성향 점수를 UserTendencyScore 대신 PhilosopherType 고정값으로 변경
- bestMatch/worstMatch도 PhilosopherType에서 자동 결정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- search 도메인 신설 (controller, service, dto, enum)
- GET /api/v1/search/battles 엔드포인트 추가
- 카테고리 태그 필터, 인기순/최신순 정렬, offset 페이지네이션 지원
- BattleRepository에 searchAll, searchByCategory 쿼리 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Vote, Perspective, PerspectiveComment, PerspectiveLike, CreditHistory 엔티티의 Long userId를 @manytoone User로 전환
- Perspective의 Long battleId, optionId도 @manytoone Battle, BattleOption으로 전환
- 전 도메인 컨트롤러의 Long userId = 1L 하드코딩을 @AuthenticationPrincipal Long userId로 교체
- Repository 파생 쿼리 메서드명을 엔티티 ���조에 맞게 정리
- S3 임시 구현 TODO, AdMob 포인트 TODO 등 해소된 TODO 주석 제거
- 관련 서비스·테스트 일괄 수정 및 빌드 검증 완료

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@jucheonsu jucheonsu left a comment

Choose a reason for hiding this comment

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

고생하셨고 감사합니다! Merge 진행해주시면 감사드리겠습니다!

@Dante0922 Dante0922 merged commit 005ac76 into dev Mar 28, 2026
@Dante0922 Dante0922 deleted the refactor/#51-user-entity-todo branch March 28, 2026 14:21
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.

♻️ Refactor: User Entity 연결 및 Todo 해결

2 participants