-
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: 어드민 전체 스터디 조회 V2 API 구현 (#875)
* feat: 학생 / 관리자 페이지 별 스터디 DTO 추가 * feat: 스터디 애그리거트 페치 조인해서 조회하는 로직 추가 * feat: DTO 정적 팩토리 추가 * feat: 전체 스터디 조회 어드민 API 추가 * refactor: V2 네이밍 제거
- Loading branch information
Showing
12 changed files
with
178 additions
and
9 deletions.
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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/gdschongik/gdsc/domain/studyv2/dao/StudyV2CustomRepository.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,8 +1,11 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dao; | ||
|
||
import com.gdschongik.gdsc.domain.studyv2.domain.StudyV2; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface StudyV2CustomRepository { | ||
Optional<StudyV2> findFetchById(Long id); | ||
|
||
List<StudyV2> findFetchAll(); | ||
} |
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
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyManagerDto.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,45 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.dto; | ||
|
||
import com.gdschongik.gdsc.domain.common.vo.Period; | ||
import com.gdschongik.gdsc.domain.common.vo.Semester; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyType; | ||
import com.gdschongik.gdsc.domain.studyv2.domain.StudyV2; | ||
import java.time.DayOfWeek; | ||
import java.time.LocalTime; | ||
|
||
/** | ||
* 스터디 관리자 DTO입니다. 디스코드 관련 ID가 포함되어 있습니다. | ||
*/ | ||
public record StudyManagerDto( | ||
Long studyId, | ||
StudyType type, | ||
String title, | ||
String description, | ||
String descriptionNotionLink, | ||
Semester semester, | ||
Integer totalRound, | ||
DayOfWeek dayOfWeek, | ||
LocalTime startTime, | ||
LocalTime endTime, | ||
Period applicationPeriod, | ||
String discordChannelId, | ||
String discordRoleId, | ||
Long mentorId) { | ||
public static StudyManagerDto from(StudyV2 study) { | ||
return new StudyManagerDto( | ||
study.getId(), | ||
study.getType(), | ||
study.getTitle(), | ||
study.getDescription(), | ||
study.getDescriptionNotionLink(), | ||
study.getSemester(), | ||
study.getTotalRound(), | ||
study.getDayOfWeek(), | ||
study.getStartTime(), | ||
study.getEndTime(), | ||
study.getApplicationPeriod(), | ||
study.getDiscordChannelId(), | ||
study.getDiscordRoleId(), | ||
study.getMentor().getId()); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudySessionManagerDto.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,31 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.dto; | ||
|
||
import com.gdschongik.gdsc.domain.common.vo.Period; | ||
import com.gdschongik.gdsc.domain.studyv2.domain.StudySessionV2; | ||
|
||
/** | ||
* 스터디 회차 관리자 DTO입니다. 출결번호가 포함되어 있습니다. | ||
*/ | ||
public record StudySessionManagerDto( | ||
Long studySessionId, | ||
Integer position, | ||
String title, | ||
String description, | ||
String lessonAttendanceNumber, | ||
Period lessonPeriod, | ||
String assignmentDescriptionLink, | ||
Period assignmentPeriod, | ||
Long studyId) { | ||
public static StudySessionManagerDto from(StudySessionV2 studySession) { | ||
return new StudySessionManagerDto( | ||
studySession.getId(), | ||
studySession.getPosition(), | ||
studySession.getTitle(), | ||
studySession.getDescription(), | ||
studySession.getLessonAttendanceNumber(), | ||
studySession.getLessonPeriod(), | ||
studySession.getAssignmentDescriptionLink(), | ||
studySession.getAssignmentPeriod(), | ||
studySession.getStudy().getId()); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudySessionStudentDto.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,14 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.dto; | ||
|
||
/** | ||
* 스터디 회차 학생 DTO입니다. 출결번호가 포함되어 있지 않습니다. | ||
*/ | ||
public record StudySessionStudentDto( | ||
Long studySessionId, | ||
Integer position, | ||
String title, | ||
String description, | ||
String lessonAttendanceStatus, | ||
String assignmentDescriptionLink, | ||
String assignmentStatus, | ||
Long studyId) {} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyStudentDto.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,24 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.dto; | ||
|
||
import com.gdschongik.gdsc.domain.common.vo.Period; | ||
import com.gdschongik.gdsc.domain.common.vo.Semester; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyType; | ||
import java.time.DayOfWeek; | ||
import java.time.LocalTime; | ||
|
||
/** | ||
* 스터디 학생 DTO입니다. 디스코드 관련 ID가 포함되어 있지 않습니다. | ||
*/ | ||
public record StudyStudentDto( | ||
Long studyId, | ||
StudyType type, | ||
String title, | ||
String description, | ||
String descriptionNotionLink, | ||
Semester semester, | ||
Integer totalRound, | ||
DayOfWeek dayOfWeek, | ||
LocalTime startTime, | ||
LocalTime endTime, | ||
Period applicationPeriod, | ||
Long mentorId) {} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/response/StudyManagerResponse.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,16 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.studyv2.domain.StudyV2; | ||
import com.gdschongik.gdsc.domain.studyv2.dto.dto.StudyManagerDto; | ||
import com.gdschongik.gdsc.domain.studyv2.dto.dto.StudySessionManagerDto; | ||
import java.util.List; | ||
|
||
public record StudyManagerResponse(StudyManagerDto study, List<StudySessionManagerDto> studySessions) { | ||
public static StudyManagerResponse from(StudyV2 study) { | ||
return new StudyManagerResponse( | ||
StudyManagerDto.from(study), | ||
study.getStudySessions().stream() | ||
.map(StudySessionManagerDto::from) | ||
.toList()); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/response/StudyStudentResponse.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,7 @@ | ||
package com.gdschongik.gdsc.domain.studyv2.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.studyv2.dto.dto.StudySessionStudentDto; | ||
import com.gdschongik.gdsc.domain.studyv2.dto.dto.StudyStudentDto; | ||
import java.util.List; | ||
|
||
public record StudyStudentResponse(StudyStudentDto study, List<StudySessionStudentDto> studySessions) {} |