Skip to content

Conversation

@doyou1
Copy link
Contributor

@doyou1 doyou1 commented Jan 14, 2026

Fixes #222

Summary

책 검색 및 좋아요 API 응답에 챌린지 생성 가능 여부를 사전에 확인할 수 있는 속성을 추가하여, POST api/v3/challenges 호출 전 검증을 수행하도록 개선했습니다.

Changes

  • SearchBookResponse 모델 확장

    • alreadyExists, hasChapter, hasQuiz 속성 추가
    • Freezed, JSON 직렬화 파일 자동 생성
  • LikeBookResponse 모델 확장

    • alreadyExists, hasChapter, hasQuiz 속성 추가
    • Freezed, JSON 직렬화 파일 자동 생성
  • SearchBookViewModel 로직 개선

    • createChallenges 메서드 반환 타입 단순화 (튜플 → int)
    • 챌린지 생성 가능 여부는 API 응답으로 사전 확인
  • 챌린지 검색 화면 UX 개선

    • ReadingChallengeSearchNewScreen
    • ReadingChallengeSearchNewMyLikesScreen
    • API 응답의 속성을 활용하여 POST 전 검증:
      • alreadyExists: 이미 진행중인 챌린지 확인
      • hasChapter: 목차 존재 여부 확인
      • hasQuiz: 퀴즈 존재 여부 확인 후 다이얼로그 표시

Test Plan

  • 알라딘 책 검색 시 alreadyExists/hasChapter/hasQuiz 값이 정상 반영되는지 확인
  • 좋아요한 책 목록에서 alreadyExists/hasChapter/hasQuiz 값이 정상 반영되는지 확인
  • 이미 진행중인 챌린지 선택 시 토스트 메시지 표시 확인
  • 목차가 없는 책 선택 시 토스트 메시지 표시 확인
  • 퀴즈가 없는 책 선택 시 다이얼로그 표시 확인
  • 모든 조건을 만족하는 책 선택 시 챌린지 시작 화면 이동 확인
Before After

🤖 Generated with Claude Code

- SearchBookResponse 모델 확장
  - alreadyExists, hasChapter, hasQuiz 속성 추가
  - 자동 생성 파일 업데이트 (freezed, g.dart)
- LikeBookResponse 모델 확장
  - alreadyExists, hasChapter, hasQuiz 속성 추가
  - 자동 생성 파일 업데이트 (freezed, g.dart)
- SearchBookViewModel 수정
  - createChallenges 메서드 반환 타입 단순화 (튜플 → int)
  - 챌린지 생성 가능 여부는 API 응답으로 사전 확인
- 챌린지 검색 화면 로직 개선
  - ReadingChallengeSearchNewScreen
  - ReadingChallengeSearchNewMyLikesScreen
  - API 응답 속성을 활용하여 POST 전 검증 수행
  - alreadyExists: 이미 진행중인 챌린지 확인
  - hasChapter: 목차 존재 여부 확인
  - hasQuiz: 퀴즈 존재 여부 확인 후 다이얼로그 표시
- BookPickSearchViewModel 코드 포매팅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @doyou1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 책 검색 및 좋아요 API 응답에 챌린지 생성 관련 상태를 미리 알려주는 속성을 추가하여, 챌린지 생성 전 클라이언트 측에서 유효성 검사를 수행할 수 있도록 합니다. 이를 통해 불필요한 API 호출을 줄이고, 사용자에게 더 빠르고 명확한 피드백을 제공하여 챌린지 생성 흐름의 사용자 경험을 향상시킵니다.

Highlights

  • API 응답 모델 확장: 책 검색 및 좋아요 API 응답 모델(SearchBookResponse, LikeBookResponse)에 alreadyExists, hasChapter, hasQuiz 속성을 추가하여 챌린지 생성 가능 여부를 사전에 확인할 수 있도록 했습니다.
  • 챌린지 생성 로직 개선: SearchBookViewModel의 createChallenges 메서드 반환 타입을 튜플에서 단일 int (challengeId)로 단순화했습니다. 이제 챌린지 생성 전 검증은 API 응답의 새로운 속성을 활용합니다.
  • 챌린지 검색 화면 UX 개선: ReadingChallengeSearchNewScreen 및 ReadingChallengeSearchNewMyLikesScreen에서 책 선택 시, API 응답의 alreadyExists, hasChapter, hasQuiz 속성을 사용하여 챌린지 생성 전 유효성 검사를 수행하고, 사용자에게 적절한 토스트 메시지나 다이얼로그를 표시하도록 개선했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@doyou1 doyou1 self-assigned this Jan 14, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 책 검색 및 좋아요 API 응답에 alreadyExists, hasChapter, hasQuiz 속성을 추가하여 챌린지 생성 가능 여부를 미리 확인하도록 개선하는 내용을 담고 있습니다. 이를 통해 불필요한 API 호출을 줄이고 사용자 경험을 개선했습니다.

전반적으로 변경 사항은 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.

alreadyExists/hasChapter/hasQuiz 속성을 책 조회 API에 추가

2 participants