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: 내 할일 목록 조회 API 추가 #671

Merged
merged 8 commits into from
Aug 24, 2024

Conversation

seulgi99
Copy link
Contributor

@seulgi99 seulgi99 commented Aug 22, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 내할일목록 API입니다
  • StudentStudyDetailService에 해당 response를 만들어 list에 add해지는 로직이 길어져서 따로 private 메소드로 빼려고 했으나, 그렇다면 해당 메소드안에서 또 isAttended, getSubmittedAssignment 메소드들을 호출하면서 함수의 depth가 너무 길어질까봐 따로 빼진 않았습니다.
  • 그리고 StudyDetail 안에서 출석일자를 가져오는 함수인 getAttendanceDay메소드가 스터디기간 시작요일이 스터디요일 보다 늦은 경우를 고려하지 않고 있어서 보강했습니다!

📝 참고사항

📚 기타

Summary by CodeRabbit

  • New Features

    • 특정 스터디에 관련된 과제 목록을 조회할 수 있는 새로운 API 엔드포인트 추가.
    • 스터디 관련 작업을 효과적으로 관리하기 위한 StudyTodoResponse 클래스 도입.
    • 과제와 세션의 상태를 확인할 수 있는 isOpened() 메서드 추가.
  • Bug Fixes

    • getAttendanceDay 메서드의 가독성과 유지 관리성을 개선하여 더 명확한 계산 로직 제공.

@seulgi99 seulgi99 added the ✨ feature 새로운 기능 추가 및 수정 label Aug 22, 2024
@seulgi99 seulgi99 self-assigned this Aug 22, 2024
@seulgi99 seulgi99 requested a review from a team as a code owner August 22, 2024 15:25
Copy link

coderabbitai bot commented Aug 22, 2024

Walkthrough

이번 변경 사항은 StudentStudyDetailController 클래스에 새로운 API 엔드포인트를 추가하고, StudentStudyDetailService 클래스에 과제 및 출석 정보를 통합하여 특정 학습에 대한 작업 목록을 조회할 수 있는 기능을 제공합니다. 또한, 관련 DTO 및 도메인 클래스에 새로운 메서드와 구조를 추가하여 더 나은 데이터 처리 및 표현을 가능하게 합니다.

Changes

파일 경로 변경 요약
src/.../api/StudentStudyDetailController.java getStudyTodoList 메서드 추가, 특정 학습에 대한 작업 목록 조회 가능
src/.../application/StudentStudyDetailService.java getStudyTodoList 메서드 추가, 출석 및 과제 정보 통합하여 작업 목록 조회 기능 구현
src/.../domain/StudyDetail.java getAttendanceDay 메서드 개선, 가독성 및 유지보수성 향상
src/.../domain/vo/Assignment.java isOpened() 메서드 추가, 과제 상태 확인 기능 구현
src/.../domain/vo/Session.java isOpened() 메서드 추가, 세션 상태 확인 기능 구현
src/.../dto/response/StudyTodoResponse.java StudyTodoResponse 클래스 추가, 작업 정보를 표현하기 위한 DTO 구현

Sequence Diagram(s)

sequenceDiagram
    participant Controller
    participant Service
    participant Repository
    participant DTO

    Controller->>Service: getStudyTodoList(studyId)
    Service->>Repository: fetchStudyDetails(studyId)
    Repository-->>Service: studyDetails
    Service->>Repository: fetchAttendanceHistory(memberId, studyId)
    Repository-->>Service: attendanceHistory
    Service->>Repository: fetchAssignmentHistories(memberId, studyId)
    Repository-->>Service: assignmentHistories
    Service-->>DTO: createStudyTodoResponse(studyDetails, attendanceHistory, assignmentHistories)
    DTO-->>Controller: List<StudyTodoResponse>
    Controller-->>Client: ResponseEntity<List<StudyTodoResponse>>
Loading

Assessment against linked issues

Objective Addressed Explanation
내할일 목록 조회 API 추가 (#670)

🐰 새로운 기능이 생겼어요,
학습의 길이 더 넓어졌죠.
할 일 목록을 손에 쥐고,
출석과 과제, 함께 보고!
Rabbit과 함께 즐거운 학습,
새로운 세계, 다 함께 춤춰요! 🌟


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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Copy link

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 986dda9 and 617fbd7.

Files selected for processing (6)
  • src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Session.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyTodoResponse.java (1 hunks)
Additional context used
Learnings (1)
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (1)
Learnt from: Sangwook02
PR: GDSC-Hongik/gdsc-server#431
File: src/main/java/com/gdschongik/gdsc/domain/study/application/StudyService.java:50-57
Timestamp: 2024-07-07T15:32:34.451Z
Learning: Consider using Stream API for creating lists in a more concise and potentially performant manner compared to traditional for-loops.
Additional comments not posted (5)
src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Session.java (1)

60-62: 새로운 메서드 isOpened() 추가 확인

세션의 상태를 확인하는 메서드로, 코드의 가독성과 유지보수성을 높입니다. 변경 사항이 잘 반영되었습니다.

src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (1)

33-38: 새로운 엔드포인트 getStudyTodoList 추가 확인

API 문서화가 잘 되어 있으며, 서비스 레이어와의 통합도 적절하게 이루어졌습니다. 변경 사항이 잘 반영되었습니다.

src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyTodoResponse.java (1)

1-53: 새로운 파일 StudyTodoResponse 추가 확인

레코드와 관련 메서드가 잘 정의되어 있으며, 할일 타입을 구분하기 위한 enum과 정적 팩토리 메서드의 사용이 적절합니다. 변경 사항이 잘 반영되었습니다.

src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (1)

88-90: 새로운 메서드 isOpened() 추가 확인

isOpened() 메서드는 과제의 상태가 OPEN인지 확인하는 기능을 제공합니다. 이 추가는 클래스의 표현력을 향상시킵니다.

src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java (1)

100-118: getAttendanceDay 메서드 리팩토링 확인

이 메서드는 여러 단계로 나누어져 가독성과 유지보수성을 향상시켰습니다. 주간 전환을 고려한 논리도 포함되어 있습니다.

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
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

확인했습니다

@uwoobeat uwoobeat changed the title feat: 내할일 목록 조회 API 추가 feat: 내 할일 목록 조회 API 추가 Aug 23, 2024
Copy link

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 617fbd7 and 740bc84.

Files selected for processing (4)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Session.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyTodoResponse.java (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Session.java
  • src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudyTodoResponse.java

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

lgtm

@seulgi99 seulgi99 merged commit bcd0e50 into develop Aug 24, 2024
1 check passed
@seulgi99 seulgi99 deleted the feature/670-get-todo-list branch August 24, 2024 07:07
Copy link

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

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.

✨ 내할일 목록 조회 API 추가
3 participants