From a12f4244cfd43cfe05c89dadf7ae7b7520c1d979 Mon Sep 17 00:00:00 2001 From: Sin Ye Rin <91180366+nyeroni@users.noreply.github.com> Date: Thu, 21 Nov 2024 01:31:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B6=95=EC=A0=9C=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/yerong/wedle/category/event/domain/Artist.java | 2 +- .../yerong/wedle/category/event/dto/FestivalResponse.java | 2 +- .../yerong/wedle/category/event/service/ArtistService.java | 6 ++++-- .../wedle/category/event/service/FestivalService.java | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/yerong/wedle/category/event/domain/Artist.java b/src/main/java/yerong/wedle/category/event/domain/Artist.java index 5339df9..0879849 100644 --- a/src/main/java/yerong/wedle/category/event/domain/Artist.java +++ b/src/main/java/yerong/wedle/category/event/domain/Artist.java @@ -28,7 +28,7 @@ public class Artist { @Column(nullable = false) private String subname; - private String image = ""; + private final String image = ""; @OneToMany(mappedBy = "artist", cascade = CascadeType.ALL, orphanRemoval = true) private Set eventArtists; diff --git a/src/main/java/yerong/wedle/category/event/dto/FestivalResponse.java b/src/main/java/yerong/wedle/category/event/dto/FestivalResponse.java index cef3911..6b1624b 100644 --- a/src/main/java/yerong/wedle/category/event/dto/FestivalResponse.java +++ b/src/main/java/yerong/wedle/category/event/dto/FestivalResponse.java @@ -10,7 +10,7 @@ @AllArgsConstructor public class FestivalResponse { private String eventName; - private Integer year; + private String year; private String date; private List dayLineup; } diff --git a/src/main/java/yerong/wedle/category/event/service/ArtistService.java b/src/main/java/yerong/wedle/category/event/service/ArtistService.java index bea5e8f..3932033 100644 --- a/src/main/java/yerong/wedle/category/event/service/ArtistService.java +++ b/src/main/java/yerong/wedle/category/event/service/ArtistService.java @@ -18,17 +18,19 @@ public List getTopArtists() { List artistResponses = topArtistsData.stream() .map(record -> { + String image = (record[3] != null) ? String.valueOf(record[3]) : ""; ArtistTop10Response response = new ArtistTop10Response( String.valueOf(record[1]), String.valueOf(record[2]), - String.valueOf(record[3]), + image, + ((Number) record[4]).intValue() ); return response; }) .limit(10) .collect(Collectors.toList()); - + return artistResponses; } } \ No newline at end of file diff --git a/src/main/java/yerong/wedle/category/event/service/FestivalService.java b/src/main/java/yerong/wedle/category/event/service/FestivalService.java index 704ae87..eb8c74f 100644 --- a/src/main/java/yerong/wedle/category/event/service/FestivalService.java +++ b/src/main/java/yerong/wedle/category/event/service/FestivalService.java @@ -51,7 +51,7 @@ private FestivalResponse convertToFestivalResponse(Festival festival) { .collect(Collectors.toList()); return new FestivalResponse( festival.getName(), - festival.getFestivalYear(), + String.valueOf(festival.getFestivalYear()), festival.getDate(), dayLineup );