Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

템플릿 반환 값에 생성 시간 포함하도록 변경 #353

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ public record FindAllTemplatesResponse(
@Schema(description = "템플릿 목록")
List<ItemResponse> templates
) {

public record ItemResponse(
@Schema(description = "템플릿 식별자", example = "0")
Long id,
@Schema(description = "템플릿 이름", example = "스프링 로그인 구현")
String title,
@Schema(description = "템플릿 설명", example = "Jwt 토큰을 이용하여 로그인 기능을 구현합니다.")
String description,
@Schema(description = "태그 리스트")
@Schema(description = "태그 목록")
List<FindTagResponse> tags,
@Schema(description = "템플릿 생성 시간", example = "2024-11-10 12:00", type = "string")
LocalDateTime createdAt,
@Schema(description = "템플릿 수정 시간", example = "2024-11-11 12:00", type = "string")
LocalDateTime modifiedAt
) {
Expand All @@ -36,6 +37,7 @@ public static ItemResponse of(Template template, List<Tag> templateTags) {
templateTags.stream()
.map(tag -> new FindTagResponse(tag.getId(), tag.getName()))
.toList(),
template.getCreatedAt(),
template.getModifiedAt()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public record FindTemplateResponse(
@Schema(description = "태그 목록")
List<FindTagResponse> tags,

@Schema(description = "템플릿 생성 시간", example = "2024-11-10 12:00", type = "string")
LocalDateTime createdAt,
@Schema(description = "템플릿 수정 시간", example = "2024-11-11 12:00", type = "string")
LocalDateTime modifiedAt
) {
Expand All @@ -39,6 +41,7 @@ public static FindTemplateResponse of(Template template, List<Snippet> snippets,
mapToFindAllSnippetByTemplateResponse(snippets),
FindCategoryResponse.from(template.getCategory()),
mapToFindTagByTemplateResponse(tags),
template.getCreatedAt(),
template.getModifiedAt()
);
}
Expand Down