Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 커리큘럼 응답에 상태 필드 추가 #733

Merged

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Sep 2, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 커리큘럼 응답 dto에 상태 필드 추가했습니다.

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 새로운 기능
    • 커리큘럼 상태를 포함하는 새로운 필드 curriculumStatus가 추가되어, 커리큘럼에 대한 추가 정보를 제공합니다.
  • 버그 수정
    • StudyCurriculumResponse의 정적 메서드가 업데이트되어 커리큘럼 상태를 올바르게 처리합니다.

@Sangwook02 Sangwook02 self-assigned this Sep 2, 2024
@Sangwook02 Sangwook02 requested a review from a team as a code owner September 2, 2024 02:00
@Sangwook02 Sangwook02 added the ✨ feature 새로운 기능 추가 및 수정 label Sep 2, 2024
Copy link

coderabbitai bot commented Sep 2, 2024

Walkthrough

StudyCurriculumResponse 클래스에 curriculumStatus 필드가 추가되었습니다. 이 변경은 StudyDetail 객체에서 커리큘럼 상태를 가져와 새로운 필드에 할당하는 방식으로, 응답 객체의 데이터 구조를 확장합니다.

Changes

파일 경로 변경 요약
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyCurriculumResponse.java curriculumStatus 필드 추가 및 from 메서드 수정

Assessment against linked issues

Objective Addressed Explanation
커리큘럼 응답에 스터디 상태 필드 추가 (#732)

Poem

🐰
커리큘럼에 새로 생긴 상태,
스터디의 흐름을 담아내네.
정보가 풍성해진 이 순간,
모두가 함께 기뻐하네!
🥕✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

Copy link

github-actions bot commented Sep 2, 2024

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyCurriculumResponse.java (1)

Line range hint 10-27: 코드 개선 제안

현재 구현은 PR 목표를 달성하고 있지만, 다음과 같은 개선을 고려해 볼 수 있습니다:

  1. curriculumStatus의 의미와 가능한 값에 대한 간단한 주석을 추가하는 것이 좋습니다.
  2. StudyStatus가 null일 경우를 처리하는 방법을 고려해 보세요. 예를 들어, Optional을 사용하거나 기본값을 설정할 수 있습니다.

다음과 같은 변경을 고려해 보세요:

public record StudyCurriculumResponse(
        Long studyDetailId,
        Period period,
        Long week,
        String title,
        String description,
        Difficulty difficulty,
+       // 커리큘럼의 현재 상태를 나타냅니다 (예: 진행 중, 완료됨 등)
        StudyStatus curriculumStatus) {

    public static StudyCurriculumResponse from(StudyDetail studyDetail) {
        Curriculum curriculum = studyDetail.getCurriculum();
        return new StudyCurriculumResponse(
                studyDetail.getId(),
                studyDetail.getPeriod(),
                studyDetail.getWeek(),
                curriculum.getTitle(),
                curriculum.getDescription(),
                curriculum.getDifficulty(),
+               Optional.ofNullable(curriculum.getStatus()).orElse(StudyStatus.NOT_STARTED));
    }
}

이 변경은 curriculumStatus에 대한 설명을 추가하고, null 값을 처리하는 방법을 제안합니다.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b2f41b5 and 267ebfb.

Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyCurriculumResponse.java (2 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyCurriculumResponse.java (3)

6-6: 새로운 import 추가 확인

StudyStatus import가 추가되었습니다. 이는 새로운 curriculumStatus 필드를 위한 것으로 보입니다.


10-16: 레코드 선언 업데이트 확인

StudyCurriculumResponse 레코드에 curriculumStatus 필드가 추가되었습니다. 이는 PR 목표와 일치합니다.


26-27: from 메서드 업데이트 확인

from 메서드가 새로운 curriculumStatus 필드를 포함하도록 업데이트되었습니다. curriculum.getStatus()를 사용하여 값을 설정하고 있습니다.

Copy link
Member

@AlmondBreez3 AlmondBreez3 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@seulgi99 seulgi99 left a comment

Choose a reason for hiding this comment

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

LGTM

@Sangwook02 Sangwook02 merged commit 0d66161 into develop Sep 2, 2024
1 check passed
@Sangwook02 Sangwook02 deleted the feature/732-add-study-status-to-curriculum-response branch September 2, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 새로운 기능 추가 및 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 커리큘럼 응답에 스터디 상태 필드 추가
3 participants