File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/main/java/sopt/org/hmh/domain/banner Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,5 @@ public class Banner {
22
22
private String subTitle ;
23
23
private String imageUrl ;
24
24
private String linkUrl ;
25
+ private String backgroundColors ;
25
26
}
Original file line number Diff line number Diff line change 2
2
3
3
import lombok .Builder ;
4
4
5
+ import java .util .List ;
6
+
5
7
@ Builder
6
8
public record BannerResponse (
7
9
String title ,
8
10
String subTitle ,
9
11
String imageUrl ,
10
- String linkUrl
12
+ String linkUrl ,
13
+ List <String > backgroundColors
14
+
11
15
) {
12
16
public static BannerResponse of (Banner banner ) {
13
17
return BannerResponse .builder ()
14
18
.title (banner .getTitle ())
15
19
.subTitle (banner .getSubTitle ())
16
20
.imageUrl (banner .getImageUrl ())
17
21
.linkUrl (banner .getLinkUrl ())
22
+ .backgroundColors (convertToColorArray (banner .getBackgroundColors ()))
18
23
.build ();
19
24
}
25
+
26
+ private static List <String > convertToColorArray (String input ) {
27
+ String [] colorArray = input .split (",\\ s*" );
28
+ return List .of (colorArray );
29
+ }
20
30
}
You can’t perform that action at this time.
0 commit comments