Skip to content
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 @@ -32,9 +32,14 @@ public static BannerResponseDTO.GetBannerListDTO toBannerListDTO(List<BannerResp

public static BannerResponseDTO.GetBannerDetailDTO toBannerDetailDTO(Banner banner, Optional<Media> thumbnailMediaOptional, List<Media> attachments) {

String thumbnailUrl = null;
BannerResponseDTO.thumbnailDTO thumbnail = null;
if (thumbnailMediaOptional.isPresent()) {
thumbnailUrl = thumbnailMediaOptional.get().getUrl();
Media thumbnailMedia = thumbnailMediaOptional.get();
thumbnail = BannerResponseDTO.thumbnailDTO.builder()
.thumbnailId(thumbnailMedia.getId())
.url(thumbnailMedia.getUrl())
.fileName(thumbnailMedia.getOriginalFileName())
.build();
}

List<BannerResponseDTO.AttachmentDTO> attachmentDTOs = attachments.stream()
Expand All @@ -51,7 +56,7 @@ public static BannerResponseDTO.GetBannerDetailDTO toBannerDetailDTO(Banner bann
banner.getTitle(),
banner.getContent(),
banner.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy.MM.dd")),
thumbnailUrl,
thumbnail,
attachmentDTOs
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gongspot.project.domain.banner.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand Down Expand Up @@ -31,7 +32,7 @@ public static class GetBannerDetailDTO {
String title;
String content;
String datetime;
String thumbnailUrl;
thumbnailDTO thumbnail;
List<AttachmentDTO> attachments;
}

Expand All @@ -44,4 +45,14 @@ public static class AttachmentDTO {
private String url;
private String fileName;
}

@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class thumbnailDTO {
private Long thumbnailId;
private String url;
private String fileName;
}
}
3 changes: 0 additions & 3 deletions src/main/resources/application-local.properties

This file was deleted.