2323import com .inninglog .inninglog .domain .team .domain .Team ;
2424import com .inninglog .inninglog .domain .team .service .TeamGetService ;
2525import com .inninglog .inninglog .global .s3 .S3Uploader ;
26+ import com .inninglog .inninglog .global .s3 .ThumbnailUrlGenerator ;
2627import lombok .RequiredArgsConstructor ;
2728import org .springframework .data .domain .Page ;
2829import org .springframework .data .domain .Slice ;
@@ -51,6 +52,7 @@ public class JournalUsecase {
5152 private final GameReportService gameReportService ;
5253 private final GameGetService gameGetService ;
5354 private final S3Uploader s3Uploader ;
55+ private final ThumbnailUrlGenerator thumbnailUrlGenerator ;
5456 private final LikeValidateService likeValidateService ;
5557 private final ScrapValidateService scrapValidateService ;
5658 private final CommentGetService commentGetService ;
@@ -96,7 +98,7 @@ public Page<JournalSumListResDto> getJournalsByMemberSum(
9698 return journals .map (
9799 journal -> JournalSumListResDto .from (
98100 journal ,
99- s3Uploader . getDirectUrl (journal .getMedia_url ()),
101+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
100102 member .getTeam ().getShortCode (),
101103 likedIds .contains (journal .getId ()),
102104 scrapedIds .contains (journal .getId ())
@@ -184,7 +186,7 @@ public SliceResponse<JournalFeedResDto> getPublicJournalFeed(Long memberId, Stri
184186
185187 return JournalFeedResDto .from (
186188 journal ,
187- s3Uploader . getDirectUrl (journal .getMedia_url ()),
189+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
188190 writedByMe ,
189191 likedByMe ,
190192 scrapedByMe
@@ -219,7 +221,7 @@ public SliceResponse<JournalFeedResDto> searchPublicJournals(Long memberId, Stri
219221
220222 return JournalFeedResDto .from (
221223 journal ,
222- s3Uploader . getDirectUrl (journal .getMedia_url ()),
224+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
223225 writedByMe ,
224226 likedByMe ,
225227 scrapedByMe
@@ -244,7 +246,7 @@ public SliceResponse<JournalSumListResDto> getMyJournals(Member member, Pageable
244246 Slice <JournalSumListResDto > dtoSlice = journals .map (
245247 journal -> JournalSumListResDto .from (
246248 journal ,
247- s3Uploader . getDirectUrl (journal .getMedia_url ()),
249+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
248250 member .getTeam ().getShortCode (),
249251 likedIds .contains (journal .getId ()),
250252 scrapedIds .contains (journal .getId ())
@@ -298,7 +300,7 @@ public SliceResponse<JournalFeedResDto> getPopularJournals(Long memberId, Pageab
298300
299301 return JournalFeedResDto .from (
300302 journal ,
301- s3Uploader . getDirectUrl (journal .getMedia_url ()),
303+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
302304 writedByMe ,
303305 likedByMe ,
304306 scrapedByMe
@@ -333,7 +335,7 @@ private SliceResponse<JournalFeedResDto> toFeedPage(Slice<Long> journalIdSlice,
333335
334336 return JournalFeedResDto .from (
335337 journal ,
336- s3Uploader . getDirectUrl (journal .getMedia_url ()),
338+ thumbnailUrlGenerator . generateThumbnailUrl (journal .getMedia_url ()),
337339 writedByMe ,
338340 likedByMe ,
339341 scrapedByMe
0 commit comments