Skip to content

ggg#111

Merged
lejuho merged 1 commit into
developfrom
refactor/final-avatar-register-and-survey
Aug 26, 2025
Merged

ggg#111
lejuho merged 1 commit into
developfrom
refactor/final-avatar-register-and-survey

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Aug 26, 2025

ㅎㅎㅎ

Summary by CodeRabbit

  • New Features

    • 일일 질문을 ID로 조회하는 기능을 추가했습니다.
    • 일일 질문 답변 제출 시 질문 ID와 숫자형 답변을 지원해 입력을 단순화했습니다.
    • API 요청 스키마가 변경되었습니다: questionId(숫자 ID), answer(숫자 선택값).
  • Bug Fixes

    • 선택 가능한 아바타 목록에서 시스템용 아바타가 더 이상 표시되지 않도록 수정했습니다.

@lejuho lejuho merged commit 3d1f98a into develop Aug 26, 2025
1 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

아바타 선택/생성 로직을 조정하고, 데일리 질문 응답 흐름을 ID 기반 조회 및 정수형 답변 매핑으로 변경했습니다. 컨트롤러에서 특정 아바타 마스터(ID 9999)를 제외하고, 서비스에서 마스터 조회 시 오프셋(+2)을 적용했습니다. 데일리 질문은 DTO 필드 변경, 서비스의 의존성 추가, ID 기반 질문 조회, 정수→enum 매핑 세터 도입이 포함됩니다.

Changes

Cohort / File(s) Summary
Avatar selection & creation
src/main/java/com/example/cp_main_be/domain/avatar/avatar/presentation/AvatarController.java, src/main/java/com/example/cp_main_be/domain/avatar/avatar/service/AvatarService.java
Controller: 선택 가능한 아바타 목록에서 ID 9999 제거. Service: createAvatar에서 masterId가 주어지면 findById(masterId + 2)로 조회하도록 변경. API 시그니처 변화 없음.
Daily question answer flow
.../member/daily_question/domain/DailyQuestionAnswer.java, .../member/daily_question/dto/DailyQuestionAnswerRequest.java, .../member/daily_question/service/DailyQuestionAnswerService.java, .../member/daily_question/service/DailyQuestionService.java
Domain: setAnswer(Integer) 추가(1→YES, 2→NEUTRAL, 기타→NO). DTO: question(String)→questionId(Long), answer(AnswerType)→answer(Integer). Service(Answer): DailyQuestionService 주입 추가, 질문을 ID로 조회, 빌더 이후 setAnswer() 호출로 답변 설정. Service(Question): getQuestionById(Long) 추가(리스트 인덱싱).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant AC as AvatarController
  participant AS as AvatarService
  participant AMR as AvatarMasterRepository

  rect rgb(245,248,255)
  note over AC: 선택 가능한 아바타 목록 조회
  C->>AC: GET /avatars/selectable
  AC->>AS: getSelectableAvatarMasters()
  AS-->>AC: List<AvatarMaster>
  AC->>AC: ID 9999 필터링
  AC-->>C: DTO List
  end

  rect rgb(245,255,245)
  note over AC,AS: 아바타 생성(마스터 지정)
  C->>AC: POST /avatars { masterId }
  AC->>AS: createAvatar(masterId)
  AS->>AMR: findById(masterId + 2)
  AMR-->>AS: AvatarMaster | NOT_FOUND
  AS-->>AC: Avatar
  AC-->>C: Response
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant DAS as DailyQuestionAnswerService
  participant DQS as DailyQuestionService
  participant DAR as DailyQuestionAnswerRepository

  rect rgb(255,248,240)
  note over C,DAS: 데일리 질문 응답 제출
  C->>DAS: submit({ questionId: Long, answer: Integer })
  DAS->>DAR: existsByUserAndAnsweredDate(user, today)
  DAR-->>DAS: boolean
  alt not exists
    DAS->>DQS: getQuestionById(questionId)
    DQS-->>DAS: String question
    DAS->>DAS: build DailyQuestionAnswer(question)
    DAS->>DAS: setAnswer(Integer)로 매핑(1/2/other)
    DAS->>DAR: save(DailyQuestionAnswer)
    DAR-->>DAS: saved
  else exists
    DAS-->>C: already answered
  end
  DAS-->>C: result
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • xoruddl
  • c5ln

Poem

귀가 팔랑, 코드에 점프!
9999는 살짝 옆으로 펌프.
질문은 ID로, 답은 숫자로 탁—
예·중·아니오, 토끼 발로 띡!
오늘의 한 줄, 저장 툭툭,
깡충깡충 PR도 쑥!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 58d5346 and e5cdfdb.

📒 Files selected for processing (6)
  • src/main/java/com/example/cp_main_be/domain/avatar/avatar/presentation/AvatarController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/avatar/avatar/service/AvatarService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/daily_question/domain/DailyQuestionAnswer.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/daily_question/dto/DailyQuestionAnswerRequest.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/daily_question/service/DailyQuestionAnswerService.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/daily_question/service/DailyQuestionService.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/final-avatar-register-and-survey

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

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.

1 participant