diff --git a/src/main/java/ject/componote/domain/design/domain/Design.java b/src/main/java/ject/componote/domain/design/domain/Design.java index e32999cc..a7162cef 100644 --- a/src/main/java/ject/componote/domain/design/domain/Design.java +++ b/src/main/java/ject/componote/domain/design/domain/Design.java @@ -12,6 +12,7 @@ import ject.componote.domain.common.model.Count; import ject.componote.domain.common.model.converter.CountConverter; import ject.componote.domain.design.domain.summary.DesignSummary; +import ject.componote.domain.design.model.DesignPhotoImage; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -38,7 +39,7 @@ private Design(final DesignSummary summary) { this.bookmarkCount = Count.create(); } - public static Design of(final String name, final String organization, final String description, final BaseImage thumbnail, final Count recommendCount) { + public static Design of(final String name, final String organization, final String description, final DesignPhotoImage thumbnail, final Count recommendCount) { return new Design(DesignSummary.of(name, organization, description, thumbnail, recommendCount)); } } diff --git a/src/main/java/ject/componote/domain/design/domain/summary/DesignSummary.java b/src/main/java/ject/componote/domain/design/domain/summary/DesignSummary.java index e192d2b2..2c7270f2 100644 --- a/src/main/java/ject/componote/domain/design/domain/summary/DesignSummary.java +++ b/src/main/java/ject/componote/domain/design/domain/summary/DesignSummary.java @@ -7,6 +7,8 @@ import ject.componote.domain.common.model.Count; import ject.componote.domain.common.model.converter.BaseImageConverter; import ject.componote.domain.common.model.converter.CountConverter; +import ject.componote.domain.design.model.DesignPhotoImage; +import ject.componote.domain.design.model.converter.DesignPhotoImageConverter; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -26,15 +28,15 @@ public class DesignSummary { @Column(name = "description", nullable = false) private String description; - @Convert(converter = BaseImageConverter.class) + @Convert(converter = DesignPhotoImageConverter.class) @Column(name = "thumbnail", nullable = false) - private BaseImage thumbnail; + private DesignPhotoImage thumbnail; @Convert(converter = CountConverter.class) @Column(name = "recommendCount", nullable = false) private Count recommendCount; - private DesignSummary(final String name, final String organization, final String description, final BaseImage thumbnail, final Count recommendCount) { + private DesignSummary(final String name, final String organization, final String description, final DesignPhotoImage thumbnail, final Count recommendCount) { this.name = name; this.organization = organization; this.description = description; @@ -42,7 +44,7 @@ private DesignSummary(final String name, final String organization, final String this.recommendCount = recommendCount; } - public static DesignSummary of(final String name, final String organization, final String description, final BaseImage thumbnail, final Count recommendCount) { + public static DesignSummary of(final String name, final String organization, final String description, final DesignPhotoImage thumbnail, final Count recommendCount) { return new DesignSummary(name, organization, description, thumbnail, recommendCount); } } diff --git a/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java b/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java index b4b58392..be5de537 100644 --- a/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java +++ b/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java @@ -12,7 +12,8 @@ public record DesignSystemSearchResponse( String description, List filters, List links, - Long recommendCount + Long recommendCount, + String thumbnailUrl ) { public static DesignSystemSearchResponse from(DesignSystem designSystem) { return new DesignSystemSearchResponse( @@ -29,7 +30,8 @@ public static DesignSystemSearchResponse from(DesignSystem designSystem) { link.getUrl().getValue() )) .collect(Collectors.toList()), - designSystem.getDesign().getSummary().getRecommendCount().getValue() + designSystem.getDesign().getSummary().getRecommendCount().getValue(), + designSystem.getDesign().getSummary().getThumbnail().toUrl() ); } diff --git a/src/test/java/ject/componote/fixture/DesignFixture.java b/src/test/java/ject/componote/fixture/DesignFixture.java index 864fa5ca..44355eb6 100644 --- a/src/test/java/ject/componote/fixture/DesignFixture.java +++ b/src/test/java/ject/componote/fixture/DesignFixture.java @@ -1,56 +1,56 @@ -package ject.componote.fixture; - -import ject.componote.domain.common.model.BaseImage; -import ject.componote.domain.design.domain.Design; -import ject.componote.domain.design.domain.filter.DesignFilter; -import ject.componote.domain.design.domain.link.DesignLink; -import ject.componote.domain.design.domain.filter.FilterType; -import ject.componote.domain.design.domain.link.LinkType; -import ject.componote.domain.design.model.Url; - -import java.util.List; - -public enum DesignFixture { - 기본_디자인("기본 디자인", "Componote", "이것은 기본 디자인입니다.", "https://example.com/thumbnail1.png"), - 추가_디자인("추가 디자인", "Componote", "이것은 추가적인 디자인입니다.", "https://example.com/thumbnail2.png"); - - private final String name; - private final String organization; - private final String description; - private final String thumbnailUrl; - - DesignFixture(String name, String organization, String description, String thumbnailUrl) { - this.name = name; - this.organization = organization; - this.description = description; - this.thumbnailUrl = thumbnailUrl; - } - - public Design 생성() { - return Design.of(name, organization, description, BaseImage.from(thumbnailUrl)); - } - - public static Design 기본_디자인_생성() { - return 기본_디자인.생성(); - } - - public static Design 추가_디자인_생성() { - return 추가_디자인.생성(); - } - - public static List 필터_리스트_생성(Long designId) { - return List.of( - DesignFilter.of(FilterType.DEVICE, "DEVICE", designId), - DesignFilter.of(FilterType.CONTENT, "CONTENT", designId) - ); - } - - public static List 링크_리스트_생성(Long designId) { - return List.of( - DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), - LinkType.FIGMA, Url.from("https://example.com/link1")), - DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), - LinkType.CODE_PEN, Url.from("https://example.com/link2")) - ); - } -} +//package ject.componote.fixture; +// +//import ject.componote.domain.common.model.BaseImage; +//import ject.componote.domain.design.domain.Design; +//import ject.componote.domain.design.domain.filter.DesignFilter; +//import ject.componote.domain.design.domain.link.DesignLink; +//import ject.componote.domain.design.domain.filter.FilterType; +//import ject.componote.domain.design.domain.link.LinkType; +//import ject.componote.domain.design.model.Url; +// +//import java.util.List; +// +//public enum DesignFixture { +// 기본_디자인("기본 디자인", "Componote", "이것은 기본 디자인입니다.", "https://example.com/thumbnail1.png"), +// 추가_디자인("추가 디자인", "Componote", "이것은 추가적인 디자인입니다.", "https://example.com/thumbnail2.png"); +// +// private final String name; +// private final String organization; +// private final String description; +// private final String thumbnailUrl; +// +// DesignFixture(String name, String organization, String description, String thumbnailUrl) { +// this.name = name; +// this.organization = organization; +// this.description = description; +// this.thumbnailUrl = thumbnailUrl; +// } +// +// public Design 생성() { +// return Design.of(name, organization, description, BaseImage.from(thumbnailUrl)); +// } +// +// public static Design 기본_디자인_생성() { +// return 기본_디자인.생성(); +// } +// +// public static Design 추가_디자인_생성() { +// return 추가_디자인.생성(); +// } +// +// public static List 필터_리스트_생성(Long designId) { +// return List.of( +// DesignFilter.of(FilterType.DEVICE, "DEVICE", designId), +// DesignFilter.of(FilterType.CONTENT, "CONTENT", designId) +// ); +// } +// +// public static List 링크_리스트_생성(Long designId) { +// return List.of( +// DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), +// LinkType.FIGMA, Url.from("https://example.com/link1")), +// DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), +// LinkType.CODE_PEN, Url.from("https://example.com/link2")) +// ); +// } +//}