Skip to content

Commit

Permalink
fix(response): 템플릿 반환 값에 생성 시간 포함하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kyum-q committed Aug 8, 2024
1 parent 1c805e2 commit 1dce66c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 1dce66c

Please sign in to comment.