Skip to content

Commit

Permalink
Merge pull request #201 from Team-HMH/develop
Browse files Browse the repository at this point in the history
deploy - prod서버에 배너 배경색 추가 적용
  • Loading branch information
jumining authored Nov 25, 2024
2 parents f36748f + 41988b7 commit 3517d6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/sopt/org/hmh/domain/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ public class Banner {
private String subTitle;
private String imageUrl;
private String linkUrl;
private String backgroundColors;
}
12 changes: 11 additions & 1 deletion src/main/java/sopt/org/hmh/domain/banner/BannerResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@

import lombok.Builder;

import java.util.List;

@Builder
public record BannerResponse(
String title,
String subTitle,
String imageUrl,
String linkUrl
String linkUrl,
List<String> backgroundColors

) {
public static BannerResponse of(Banner banner) {
return BannerResponse.builder()
.title(banner.getTitle())
.subTitle(banner.getSubTitle())
.imageUrl(banner.getImageUrl())
.linkUrl(banner.getLinkUrl())
.backgroundColors(convertToColorArray(banner.getBackgroundColors()))
.build();
}

private static List<String> convertToColorArray(String input) {
String[] colorArray = input.split(",\\s*");
return List.of(colorArray);
}
}

0 comments on commit 3517d6f

Please sign in to comment.