-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…g-materials-to-pdf(swm-386) Feat/#132/develop api for converting materials to pdf(swm 386)
- Loading branch information
Showing
16 changed files
with
223 additions
and
32 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
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
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
13 changes: 13 additions & 0 deletions
13
src/main/java/com/m9d/sroom/material/dto/response/Answer4PdfResponse.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,13 @@ | ||
package com.m9d.sroom.material.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class Answer4PdfResponse { | ||
private int videoIndex; | ||
private int quizIndex; | ||
private String answer; | ||
private String answerStr; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/com/m9d/sroom/material/dto/response/Content4PdfResponse.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,41 @@ | ||
package com.m9d.sroom.material.dto.response; | ||
|
||
import com.m9d.sroom.common.entity.VideoEntity; | ||
import com.m9d.sroom.course.vo.CourseVideo; | ||
import com.m9d.sroom.material.model.MaterialStatus; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class Content4PdfResponse { | ||
|
||
private String videoTitle; | ||
|
||
private int index; | ||
|
||
private String channel; | ||
|
||
private boolean usable; | ||
|
||
private SummaryBrief summaryBrief; | ||
|
||
private List<Quiz4PdfResponse> quizzes; | ||
|
||
|
||
public static Content4PdfResponse create(VideoEntity videoEntity, CourseVideo courseVideo, | ||
SummaryBrief summaryBrief, List<Quiz4PdfResponse> quizzeList) { | ||
return Content4PdfResponse.builder() | ||
.videoTitle(videoEntity.getTitle()) | ||
.index(courseVideo.getVideoIndex()) | ||
.channel(videoEntity.getChannel()) | ||
.usable(courseVideo.getMaterialStatus().equals(MaterialStatus.CREATED)) | ||
.summaryBrief(summaryBrief) | ||
.quizzes(quizzeList) | ||
.build(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/m9d/sroom/material/dto/response/Material4PdfResponse.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,44 @@ | ||
package com.m9d.sroom.material.dto.response; | ||
|
||
import com.m9d.sroom.material.model.MaterialStatus; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class Material4PdfResponse { | ||
|
||
private String courseTitle; | ||
|
||
private int totalVideoCount; | ||
|
||
private int status; | ||
|
||
private List<Content4PdfResponse> materials; | ||
|
||
private List<Answer4PdfResponse> answers; | ||
|
||
public static Material4PdfResponse createUnprepared(String title, int videoCount) { | ||
return Material4PdfResponse.builder() | ||
.courseTitle(title) | ||
.totalVideoCount(videoCount) | ||
.status(MaterialStatus.CREATING.getValue()) | ||
.build(); | ||
} | ||
|
||
public static Material4PdfResponse createPrepared(String title, int videoCount, | ||
List<Content4PdfResponse> contentList, | ||
List<Answer4PdfResponse> answerList) { | ||
return Material4PdfResponse.builder() | ||
.courseTitle(title) | ||
.totalVideoCount(videoCount) | ||
.status(MaterialStatus.CREATED.getValue()) | ||
.materials(contentList) | ||
.answers(answerList) | ||
.build(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/m9d/sroom/material/dto/response/Quiz4PdfResponse.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,25 @@ | ||
package com.m9d.sroom.material.dto.response; | ||
|
||
import com.m9d.sroom.quiz.vo.Quiz; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class Quiz4PdfResponse { | ||
|
||
private int type; | ||
|
||
private int index; | ||
|
||
private String question; | ||
|
||
private List<String> options; | ||
|
||
public Quiz4PdfResponse(Quiz quiz, int index) { | ||
this.type = quiz.getType().getValue(); | ||
this.index = index; | ||
this.question = quiz.getQuestion(); | ||
this.options = quiz.getOptionStrList(); | ||
} | ||
} |
Oops, something went wrong.