-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #102
Changes from all commits
49e8339
ce79356
e7d0d4a
7be13b5
7edda34
ea1b42e
6212480
d63cc45
7276827
13a0a31
d2ec52b
0ac9ff2
a0dcef5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,13 +27,20 @@ public MainPageService(PostRepository postRepository, MemberService memberServic | |||||||||||||||||||||||||||||||||||||||||||
| this.memberService = memberService; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // 이미지 null일 때 default 사진으로 변경 (프로필 사진, | ||||||||||||||||||||||||||||||||||||||||||||
| public String getDefaultImage(String image){ | ||||||||||||||||||||||||||||||||||||||||||||
| // 이미지 null일 때 default 사진으로 변경 - 프로필 사진 | ||||||||||||||||||||||||||||||||||||||||||||
| public String getDefaultProfile(String image){ | ||||||||||||||||||||||||||||||||||||||||||||
| String imageUrl = (image == null || image.isBlank()) | ||||||||||||||||||||||||||||||||||||||||||||
| ? "https://fixlog-bucket.s3.ap-northeast-2.amazonaws.com/default/profile.png" : image; | ||||||||||||||||||||||||||||||||||||||||||||
| System.out.println(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| return imageUrl; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| // 이미지 null일 때 default 사진으로 변경 - 썸네일 | ||||||||||||||||||||||||||||||||||||||||||||
| public String getDefaultCover(String image){ | ||||||||||||||||||||||||||||||||||||||||||||
| String imageUrl = (image == null || image.isBlank()) | ||||||||||||||||||||||||||||||||||||||||||||
| ? "https://fixlogsmwubucket.s3.ap-northeast-2.amazonaws.com/default/DefaulThumnail.png" : image; | ||||||||||||||||||||||||||||||||||||||||||||
| System.out.println(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| return imageUrl; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+30
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이미지 타입별 메서드 분리는 좋으나 URL 오타 수정 필요 프로필과 썸네일 이미지를 구분하여 처리하는 것은 좋은 설계입니다. 하지만 40번 라인의 URL에 오타가 있습니다. - ? "https://fixlogsmwubucket.s3.ap-northeast-2.amazonaws.com/default/DefaulThumnail.png" : image;
+ ? "https://fixlogsmwubucket.s3.ap-northeast-2.amazonaws.com/default/DefaultThumbnail.png" : image;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // 메인페이지 보기 | ||||||||||||||||||||||||||||||||||||||||||||
| public MainPageResponseDto mainPageView(int sort, int size){ | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -44,9 +51,9 @@ public MainPageResponseDto mainPageView(int sort, int size){ | |||||||||||||||||||||||||||||||||||||||||||
| if (optionalMember.isPresent()) { | ||||||||||||||||||||||||||||||||||||||||||||
| Member member = optionalMember.get(); | ||||||||||||||||||||||||||||||||||||||||||||
| String imageUrl = member.getProfileImageUrl(); | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = getDefaultImage(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = getDefaultProfile(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = "https://example.com/default-cover-image.png"; // 비로그인 기본 이미지 | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = "https://fixlog-bucket.s3.ap-northeast-2.amazonaws.com/default/profile.png"; // 비로그인 기본 이미지 | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // 페이지 (글 12개) 불러오기 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -67,11 +74,11 @@ public MainPageResponseDto mainPageView(int sort, int size){ | |||||||||||||||||||||||||||||||||||||||||||
| List<MainPagePostResponseDto> postList = posts.stream() | ||||||||||||||||||||||||||||||||||||||||||||
| .map(post -> new MainPagePostResponseDto( | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostTitle(), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultImage(post.getCoverImage()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultCover(post.getCoverImage()), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostTags().stream() | ||||||||||||||||||||||||||||||||||||||||||||
| .map(postTag -> postTag.getTagId().getTagName()) | ||||||||||||||||||||||||||||||||||||||||||||
| .collect(Collectors.toList()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultImage(post.getUserId().getProfileImageUrl()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultProfile(post.getUserId().getProfileImageUrl()), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getUserId().getNickname(), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getCreatedAt().toLocalDate(), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostLikes().size() | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -90,9 +97,9 @@ public MainPageResponseDto mainPageFullView(int sort, int page, int size){ | |||||||||||||||||||||||||||||||||||||||||||
| if (optionalMember.isPresent()) { | ||||||||||||||||||||||||||||||||||||||||||||
| Member member = optionalMember.get(); | ||||||||||||||||||||||||||||||||||||||||||||
| String imageUrl = member.getProfileImageUrl(); | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = getDefaultImage(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = getDefaultProfile(imageUrl); | ||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = "https://example.com/default-cover-image.png"; // 비로그인 기본 이미지 | ||||||||||||||||||||||||||||||||||||||||||||
| profileImageUrl = "https://fixlog-bucket.s3.ap-northeast-2.amazonaws.com/default/profile.png"; // 비로그인 기본 이미지 | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // 페이지 설정 (한 페이지당 12개) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -109,11 +116,11 @@ public MainPageResponseDto mainPageFullView(int sort, int page, int size){ | |||||||||||||||||||||||||||||||||||||||||||
| List<MainPagePostResponseDto> postList = postPage.stream() | ||||||||||||||||||||||||||||||||||||||||||||
| .map(post -> new MainPagePostResponseDto( | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostTitle(), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultImage(post.getCoverImage()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultCover(post.getCoverImage()), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostTags().stream() | ||||||||||||||||||||||||||||||||||||||||||||
| .map(postTag -> postTag.getTagId().getTagName()) | ||||||||||||||||||||||||||||||||||||||||||||
| .collect(Collectors.toList()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultImage(post.getUserId().getProfileImageUrl()), | ||||||||||||||||||||||||||||||||||||||||||||
| getDefaultProfile(post.getUserId().getProfileImageUrl()), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getUserId().getNickname(), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getCreatedAt().toLocalDate(), | ||||||||||||||||||||||||||||||||||||||||||||
| post.getPostLikes().size() | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL 오타 수정 필요
기본 이미지 처리 메서드 추가는 좋으나, 38번 라인의 URL에 오타가 있습니다.
📝 Committable suggestion
🤖 Prompt for AI Agents