-
Notifications
You must be signed in to change notification settings - Fork 4
[feat] 커뮤니티 태그/좋아요/인기글 기능 및 API 응답 개선, JWT sub 표준화 #109
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5de62a9
[feat] 커뮤니티 게시물 태그별 최신순 조회 기능 및 수정·삭제 응답 처리 추가
iamseojin 812fc5b
[feat] 커뮤니티 게시글 좋아요 및 top 2 인기 게시물 조회 기능 추가
iamseojin 8636ede
[feat] jwt 토큰 클레임 표준화(sub=email, aud 검증) 및 인증 필터/유틸 정리
iamseojin 0007b5e
Update src/main/java/com/arom/with_travel/domain/community/Community.…
iamseojin da5cc61
Update src/main/java/com/arom/with_travel/domain/member/Member.java
iamseojin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/com/arom/with_travel/domain/community/CommunitySpecs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/arom/with_travel/domain/community/dto/CommunityDetailResponseMapper.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package com.arom.with_travel.domain.community.dto; | ||
|
|
||
| import com.arom.with_travel.domain.community.Community; | ||
| import com.arom.with_travel.domain.image.Image; | ||
|
|
||
| public class CommunityDetailResponseMapper { | ||
|
|
||
| public static CommunityDetailResponse from(Community c) { | ||
| return new CommunityDetailResponse( | ||
| c.getId(), | ||
| c.getTitle(), | ||
| c.getContent(), | ||
| c.getTag(), | ||
| c.getContinent(), | ||
| c.getCountry(), | ||
| c.getCity(), | ||
| c.getMember().getId(), | ||
| c.getMember().getNickname(), | ||
| c.getViewCount(), | ||
| c.getLikeCount(), | ||
| c.getReplyCount(), | ||
| c.getImages().stream().map(Image::getImageUrl).toList(), | ||
| c.getCreatedAt().toString(), | ||
| c.getUpdatedAt().toString() | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/arom/with_travel/domain/community/enums/CommunityTag.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package com.arom.with_travel.domain.community.enums; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| public enum CommunityTag { | ||
| RESTAURANT("맛집추천"), | ||
| CAFE("카페탐방"), | ||
| INFO("정보공유"), | ||
| TIPS("꿀팁"); | ||
|
|
||
| private final String labelKo; | ||
|
|
||
| CommunityTag(String labelKo) { | ||
| this.labelKo = labelKo; | ||
| } | ||
|
|
||
| public String getLabelKo() { | ||
| return labelKo; | ||
| } | ||
|
|
||
| @JsonCreator | ||
| public static CommunityTag from(String v) { | ||
| if (v == null) return null; | ||
| String key = v.trim(); | ||
| String upper = key.toUpperCase(); | ||
|
|
||
| return Arrays.stream(values()) | ||
| .filter(e -> e.name().equalsIgnoreCase(upper) || e.labelKo.equalsIgnoreCase(key)) | ||
| .findFirst() | ||
| .orElseThrow(() -> new IllegalArgumentException("Unknown tag: " + v)); | ||
| } | ||
|
|
||
| @JsonValue | ||
| public String toValue() { | ||
| return this.name(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.