From 824daf1b41906e09693d79d3ca25f6f24bbc827d Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 3 Jun 2024 21:06:44 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20StageQueryInfo=20updateArtist=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=EC=97=90=20=EC=A0=95=EB=A0=AC=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/festago/stage/domain/StageQueryInfo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/com/festago/stage/domain/StageQueryInfo.java b/backend/src/main/java/com/festago/stage/domain/StageQueryInfo.java index b3006979e..4f19e25d8 100644 --- a/backend/src/main/java/com/festago/stage/domain/StageQueryInfo.java +++ b/backend/src/main/java/com/festago/stage/domain/StageQueryInfo.java @@ -1,5 +1,7 @@ package com.festago.stage.domain; +import static java.util.Comparator.comparingLong; + import com.festago.artist.domain.Artist; import com.festago.artist.domain.ArtistsSerializer; import jakarta.persistence.Column; @@ -40,7 +42,10 @@ public static StageQueryInfo of(Long stageId, List artists, ArtistsSeria } public void updateArtist(List artists, ArtistsSerializer serializer) { - this.artistInfo = serializer.serialize(artists); + List sortedArtists = artists.stream() + .sorted(comparingLong(Artist::getId)) + .toList(); + this.artistInfo = serializer.serialize(sortedArtists); } public Long getId() {