File tree Expand file tree Collapse file tree
java/kb_hack/backend/domain/sos Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ public class SosDetailResponse {
5353 example = "[\" sos/2025/09/01/uuid1.jpg\" , \" sos/2025/09/01/uuid2.png\" ]" )
5454 private List <String > imageKeys ;
5555
56+ private List <Long > imageIds ;
57+
5658
5759
5860}
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ public class SosDetailRow {
2525 private LocalDateTime expiresAt ;
2626 private Date createdAt ;
2727 private String imageKey ; // sos_image.storage_key
28+ private Long sosImageId ;
29+
2830}
Original file line number Diff line number Diff line change 2323import java .time .format .DateTimeFormatter ;
2424import java .util .List ;
2525import java .util .Map ;
26+ import java .util .Objects ;
27+
2628import kb_hack .backend .domain .sos .dto .SosDetailRow ;
2729
2830
@@ -166,6 +168,10 @@ public SosDetailResponse getSosDetail(Long sosId) {
166168 if (rows .isEmpty ()) {
167169 throw new IllegalArgumentException ("존재하지 않는 SOS ID: " + sosId );
168170 }
171+ List <Long > imageIds = rows .stream ()
172+ .map (SosDetailRow ::getSosImageId )
173+ .filter (Objects ::nonNull )
174+ .toList ();
169175
170176 SosDetailRow first = rows .get (0 );
171177 List <String > imageKeys = rows .stream ()
@@ -187,6 +193,7 @@ public SosDetailResponse getSosDetail(Long sosId) {
187193 .expiresAt (first .getExpiresAt ())
188194 .createdAt (first .getCreatedAt ())
189195 .imageKeys (imageKeys )
196+ .imageIds (imageIds )
190197 .minorName (minorName )
191198 .build ();
192199
Original file line number Diff line number Diff line change 6666 s.sos_type AS sosType,
6767 s.sos_content AS sosContent,
6868 s.expires_at AS expiresAt,
69+ si.sos_image_id AS sosImageId,
6970 si.storage_key AS imageKey,
7071 s.created_at
7172 FROM sos s
You can’t perform that action at this time.
0 commit comments