diff --git a/src/main/java/sopt/org/hmh/domain/banner/Banner.java b/src/main/java/sopt/org/hmh/domain/banner/Banner.java index 09c5430..ef9b683 100644 --- a/src/main/java/sopt/org/hmh/domain/banner/Banner.java +++ b/src/main/java/sopt/org/hmh/domain/banner/Banner.java @@ -22,4 +22,5 @@ public class Banner { private String subTitle; private String imageUrl; private String linkUrl; + private String backgroundColors; } diff --git a/src/main/java/sopt/org/hmh/domain/banner/BannerResponse.java b/src/main/java/sopt/org/hmh/domain/banner/BannerResponse.java index 2a2d831..87407b4 100644 --- a/src/main/java/sopt/org/hmh/domain/banner/BannerResponse.java +++ b/src/main/java/sopt/org/hmh/domain/banner/BannerResponse.java @@ -2,12 +2,16 @@ import lombok.Builder; +import java.util.List; + @Builder public record BannerResponse( String title, String subTitle, String imageUrl, - String linkUrl + String linkUrl, + List backgroundColors + ) { public static BannerResponse of(Banner banner) { return BannerResponse.builder() @@ -15,6 +19,12 @@ public static BannerResponse of(Banner banner) { .subTitle(banner.getSubTitle()) .imageUrl(banner.getImageUrl()) .linkUrl(banner.getLinkUrl()) + .backgroundColors(convertToColorArray(banner.getBackgroundColors())) .build(); } + + private static List convertToColorArray(String input) { + String[] colorArray = input.split(",\\s*"); + return List.of(colorArray); + } }