-
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.
Merge pull request #80 from depromeet/fix/67
fix/67: 기본 템플릿 조회 API 바뀐 테이블 구조에 맞게 수정
- Loading branch information
Showing
19 changed files
with
182 additions
and
262 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
18 changes: 9 additions & 9 deletions
18
...rc/main/java/org/layer/domain/template/controller/dto/TemplateDetailQuestionResponse.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,15 +1,15 @@ | ||
package org.layer.domain.template.controller.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import org.layer.domain.template.entity.TemplateQuestion; | ||
|
||
@Builder | ||
public record TemplateDetailQuestionResponse(Long id, String entryWord, String description) { | ||
public static TemplateDetailQuestionResponse toResponse(TemplateQuestion templateQuestion) { | ||
return TemplateDetailQuestionResponse.builder() | ||
.id(templateQuestion.getId()) | ||
.entryWord(templateQuestion.getEntryWord()) | ||
.description(templateQuestion.getDescription()) | ||
.build(); | ||
} | ||
public record TemplateDetailQuestionResponse( | ||
@Schema(description = "질문 id", example = "1") | ||
Long questionId, | ||
@Schema(description = "질문", example = "어려움을 느꼈던 부분은 무엇인가요?") | ||
String question, | ||
@Schema(description = "질문에 대한 상세 설명", example = "현재 만족하고 있거나 계속 이어갔으면 하는 부분들을 작성해요.") | ||
String description | ||
) { | ||
} |
10 changes: 1 addition & 9 deletions
10
layer-api/src/main/java/org/layer/domain/template/controller/dto/TemplateListResponse.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,20 +1,12 @@ | ||
package org.layer.domain.template.controller.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import org.layer.domain.template.entity.Template; | ||
import org.springframework.data.domain.Slice; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public record TemplateListResponse( | ||
@Schema(description = "템플릿") List<TemplateSimpleInfoResponse> templateInfoList, | ||
@Schema(description = "마지막 페이지 여부") Boolean last | ||
) { | ||
public static TemplateListResponse toResponse(Slice<Template> templateSlice) { | ||
List<TemplateSimpleInfoResponse> simpleInfoList = templateSlice.getContent().stream() | ||
.map(TemplateSimpleInfoResponse::toResponse) | ||
.collect(Collectors.toList()); | ||
return new TemplateListResponse(simpleInfoList, templateSlice.isLast()); | ||
} | ||
|
||
} |
37 changes: 0 additions & 37 deletions
37
.../src/main/java/org/layer/domain/template/controller/dto/TemplateQuestionListResponse.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...-api/src/main/java/org/layer/domain/template/controller/dto/TemplateQuestionResponse.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.