@@ -25,10 +25,19 @@ public class MyPostPageResponseDto {
2525 private String nickname ;
2626 private String profileImageUrl ;;
2727
28- public static String getDefaultImage (String image ) {
29- return (image == null || image .isBlank ())
30- ? "https://fixlog-bucket.s3.ap-northeast-2.amazonaws.com/default/profile.png"
31- : image ;
28+ // 이미지 null일 때 default 사진으로 변경 - 프로필 사진
29+ public static String getDefaultProfile (String image ){
30+ String imageUrl = (image == null || image .isBlank ())
31+ ? "https://fixlog-bucket.s3.ap-northeast-2.amazonaws.com/default/profile.png" : image ;
32+ System .out .println (imageUrl );
33+ return imageUrl ;
34+ }
35+ // 이미지 null일 때 default 사진으로 변경 - 썸네일
36+ public static String getDefaultCover (String image ){
37+ String imageUrl = (image == null || image .isBlank ())
38+ ? "https://fixlogsmwubucket.s3.ap-northeast-2.amazonaws.com/default/DefaulThumnail.png" : image ;
39+ System .out .println (imageUrl );
40+ return imageUrl ;
3241 }
3342
3443 public static MyPostPageResponseDto from (Post post , int forkCount ) {
@@ -37,8 +46,8 @@ public static MyPostPageResponseDto from(Post post, int forkCount) {
3746 .nickname (post .getUserId ().getNickname ())
3847 .postTitle (post .getPostTitle ())
3948 .postSummary (generateSummary (post .getProblem ()))
40- .imageUrl (getDefaultImage (post .getCoverImage ()))
41- .profileImageUrl (getDefaultImage (post .getUserId ().getProfileImageUrl ()))
49+ .imageUrl (getDefaultCover (post .getCoverImage ()))
50+ .profileImageUrl (getDefaultProfile (post .getUserId ().getProfileImageUrl ()))
4251 .tags (post .getPostTags ().stream ().map (tag -> tag .getTagId ().getTagName ()).toList ())
4352 .createdAt (post .getCreatedAt ())
4453 .likeCount (post .getPostLikes ().size ())
0 commit comments