File tree Expand file tree Collapse file tree
src/main/java/com/semosan/api/domain/mountain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import com .semosan .api .domain .mountain .entity .MountainLike ;
55import com .semosan .api .domain .mountain .enums .Difficulty ;
66
7+ import java .util .List ;
8+
79public record LikedMountainResponse (
810 Long mountainId ,
911 String name ,
1012 String address ,
1113 Double altitude ,
1214 Difficulty difficulty ,
13- String imageUrl
15+ List < String > imageUrls
1416) {
15- // 좋아요한 산 정보로 응답 DTO를 생성합니다.
1617 public static LikedMountainResponse from (MountainLike mountainLike ) {
1718 Mountain mountain = mountainLike .getMountain ();
1819 return new LikedMountainResponse (
@@ -21,7 +22,7 @@ public static LikedMountainResponse from(MountainLike mountainLike) {
2122 mountain .getAddress (),
2223 mountain .getAltitude (),
2324 mountain .getDifficulty (),
24- mountain .getImageUrl ()
25+ mountain .getImageUrls ()
2526 );
2627 }
2728}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public record MountainInfo(
2626 Double altitude ,
2727 Difficulty difficulty ,
2828 Integer duration ,
29- String imageUrl
29+ List < String > imageUrls
3030 ) {
3131 public static MountainInfo from (Mountain mountain ) {
3232 return new MountainInfo (
@@ -36,7 +36,7 @@ public static MountainInfo from(Mountain mountain) {
3636 mountain .getAltitude (),
3737 mountain .getDifficulty (),
3838 mountain .getDuration (),
39- mountain .getImageUrl ()
39+ mountain .getImageUrls ()
4040 );
4141 }
4242 }
Original file line number Diff line number Diff line change 33import com .semosan .api .domain .mountain .entity .Mountain ;
44import com .semosan .api .domain .mountain .enums .Difficulty ;
55
6+ import java .util .List ;
7+
68public record MountainListResponse (
79 Long mountainId ,
810 String name ,
911 String address ,
1012 Double altitude ,
1113 Difficulty difficulty ,
1214 Integer duration ,
13- String imageUrl ,
15+ List < String > imageUrls ,
1416 Double latitude ,
1517 Double longitude
1618) {
@@ -23,7 +25,7 @@ public static MountainListResponse from(Mountain mountain) {
2325 mountain .getAltitude (),
2426 mountain .getDifficulty (),
2527 mountain .getDuration (),
26- mountain .getImageUrl (),
28+ mountain .getImageUrls (),
2729 mountain .getLatitude (),
2830 mountain .getLongitude ()
2931 );
Original file line number Diff line number Diff line change 44import com .semosan .api .domain .mountain .enums .Difficulty ;
55import jakarta .persistence .*;
66import lombok .*;
7+ import org .hibernate .annotations .JdbcTypeCode ;
8+ import org .hibernate .type .SqlTypes ;
9+
10+ import java .util .List ;
711
812@ Table (name = "mountains" )
913@ Getter
@@ -33,8 +37,9 @@ public class Mountain extends BaseEntity {
3337 @ Column (name = "duration" )
3438 private Integer duration ;
3539
36- @ Column (name = "image_url" , length = 500 )
37- private String imageUrl ;
40+ @ JdbcTypeCode (SqlTypes .JSON )
41+ @ Column (name = "image_urls" , columnDefinition = "jsonb" )
42+ private List <String > imageUrls ;
3843
3944 @ Column (name = "latitude" )
4045 private Double latitude ;
You can’t perform that action at this time.
0 commit comments