-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: StudyAchievementRepository 생성 * feat: 스터디 수료 내역 조회 로직 작성 * feat: 스터디 수료내역 조회 컨트롤러 추가 * refactor: 우수 스터디원 조회 로직 개선 * chore: import 코드 기존 방식으로 변경 * chore: 메서드 이름 개선 * refactor: DTO에서 achievement null 처리 * chore: import Collector * refactor: 우수 스터디원이 없으면 null 반환 * refactor: 우수 스터디원 선정 내역 기본값을 리스트로 설정 * chore: 우수 스터디원 필드 스웨거 설명 수정
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyAchievementRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package com.gdschongik.gdsc.domain.study.dao; | ||
|
||
import com.gdschongik.gdsc.domain.member.domain.Member; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyAchievement; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface StudyAchievementRepository | ||
extends JpaRepository<StudyAchievement, Long>, StudyAchievementCustomRepository {} | ||
extends JpaRepository<StudyAchievement, Long>, StudyAchievementCustomRepository { | ||
|
||
List<StudyAchievement> findAllByStudent(Member student); | ||
} |
37 changes: 37 additions & 0 deletions
37
...in/java/com/gdschongik/gdsc/domain/study/dto/response/StudentMyCompleteStudyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.gdschongik.gdsc.domain.study.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.common.model.SemesterType; | ||
import com.gdschongik.gdsc.domain.study.domain.AchievementType; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyHistory; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyHistoryStatus; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
public record StudentMyCompleteStudyResponse( | ||
Long studyId, | ||
@Schema(description = "학년도") Integer academicYear, | ||
@Schema(description = "학기") SemesterType semesterType, | ||
@Schema(description = "이름") String title, | ||
@Schema(description = "종류") String studyType, | ||
@Schema(description = "상세설명 노션 링크") String notionLink, | ||
@Schema(description = "한 줄 소개") String introduction, | ||
@Schema(description = "멘토 이름") String mentorName, | ||
@Schema(description = "총 주차수") Long totalWeek, | ||
@Schema(description = "수료 여부") StudyHistoryStatus studyHistoryStatus, | ||
@Schema(description = "우수 스터디원 선정 내역") List<AchievementType> achievements) { | ||
|
||
public static StudentMyCompleteStudyResponse of(StudyHistory studyHistory, List<AchievementType> achievements) { | ||
return new StudentMyCompleteStudyResponse( | ||
studyHistory.getStudy().getId(), | ||
studyHistory.getStudy().getAcademicYear(), | ||
studyHistory.getStudy().getSemesterType(), | ||
studyHistory.getStudy().getTitle(), | ||
studyHistory.getStudy().getStudyType().getValue(), | ||
studyHistory.getStudy().getNotionLink(), | ||
studyHistory.getStudy().getIntroduction(), | ||
studyHistory.getStudy().getMentor().getName(), | ||
studyHistory.getStudy().getTotalWeek(), | ||
studyHistory.getStudyHistoryStatus(), | ||
achievements); | ||
} | ||
} |