-
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.
- Loading branch information
Showing
7 changed files
with
65 additions
and
5 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
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
6 changes: 5 additions & 1 deletion
6
src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyDetailRepository.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,6 +1,10 @@ | ||
package com.gdschongik.gdsc.domain.study.dao; | ||
|
||
import com.gdschongik.gdsc.domain.study.domain.StudyDetail; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface StudyDetailRepository extends JpaRepository<StudyDetail, Long> {} | ||
public interface StudyDetailRepository extends JpaRepository<StudyDetail, Long> { | ||
|
||
List<StudyDetail> findAllByStudyId(Long studyId); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentResponse.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,23 @@ | ||
package com.gdschongik.gdsc.domain.study.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.study.domain.StudyDetail; | ||
import com.gdschongik.gdsc.domain.study.domain.StudyStatus; | ||
import com.gdschongik.gdsc.domain.study.domain.vo.Assignment; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record AssignmentResponse( | ||
Long studyDetailId, | ||
@Schema(description = "과제 제목") String title, | ||
@Schema(description = "마감 기한") String deadline, | ||
@Schema(description = "과제 명세 링크") String descriptionLink, | ||
@Schema(description = "과제 상태") StudyStatus assignmentStatus) { | ||
public static AssignmentResponse from(StudyDetail studyDetail) { | ||
Assignment assignment = studyDetail.getAssignment(); | ||
return new AssignmentResponse( | ||
studyDetail.getId(), | ||
assignment.getTitle(), | ||
assignment.getDeadline().toString(), | ||
assignment.getDescriptionLink(), | ||
assignment.getStatus()); | ||
} | ||
} |
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