-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: [FN-297] 그룹 조회 API 구현 #2
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 all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c7ec9c8
Feat: 그룹 조회 API 추가
stoneTiger0912 d4bf7d4
Feat: 그룹 상세 조회 API 추가
stoneTiger0912 4802de5
Merge branch 'main' into feat/find-group
stoneTiger0912 9e5f61d
Merge branch 'main' of https://github.com/FlipNoteTeam/FlipNote-Group…
stoneTiger0912 5badc92
Fix: id 누락 추가
stoneTiger0912 fc6a2ef
Merge: 충돌 해결
stoneTiger0912 3341bfd
Fix: 아키텍쳐 구조 수정
stoneTiger0912 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
Some comments aren't visible on the classic Files Changed page.
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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/flipnote/group/api/dto/response/FindGroupResponseDto.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,49 @@ | ||
| package flipnote.group.api.dto.response; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import flipnote.group.application.port.in.result.FindGroupResult; | ||
| import flipnote.group.domain.model.group.Category; | ||
| import flipnote.group.domain.model.group.Group; | ||
| import flipnote.group.domain.model.group.JoinPolicy; | ||
| import flipnote.group.domain.model.group.Visibility; | ||
|
|
||
| public record FindGroupResponseDto( | ||
| Long groupId, | ||
|
|
||
| String name, | ||
|
|
||
| Category category, | ||
|
|
||
| String description, | ||
|
|
||
| JoinPolicy joinPolicy, | ||
|
|
||
| Visibility visibility, | ||
|
|
||
| Integer maxMember, | ||
|
|
||
| Long imageRefId, | ||
|
|
||
| LocalDateTime createdAt, | ||
|
|
||
| LocalDateTime modifiedAt | ||
| ) { | ||
| public static FindGroupResponseDto from(FindGroupResult result) { | ||
|
|
||
| Group group = result.group(); | ||
|
|
||
| return new FindGroupResponseDto( | ||
| group.getId(), | ||
| group.getName(), | ||
| group.getCategory(), | ||
| group.getDescription(), | ||
| group.getJoinPolicy(), | ||
| group.getVisibility(), | ||
| group.getMaxMember(), | ||
| group.getImageRefId(), | ||
| group.getCreatedAt(), | ||
| group.getModifiedAt() | ||
| ); | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/main/java/flipnote/group/application/port/in/FindGroupUseCase.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,8 @@ | ||
| package flipnote.group.application.port.in; | ||
|
|
||
| import flipnote.group.application.port.in.command.FindGroupCommand; | ||
| import flipnote.group.application.port.in.result.FindGroupResult; | ||
|
|
||
| public interface FindGroupUseCase { | ||
| FindGroupResult findGroup(FindGroupCommand cmd); | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/flipnote/group/application/port/in/command/FindGroupCommand.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,7 @@ | ||
| package flipnote.group.application.port.in.command; | ||
|
|
||
| public record FindGroupCommand( | ||
| Long userId, | ||
| Long groupId | ||
| ) { | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/flipnote/group/application/port/in/result/FindGroupResult.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,7 @@ | ||
| package flipnote.group.application.port.in.result; | ||
|
|
||
| import flipnote.group.domain.model.group.Group; | ||
|
|
||
| public record FindGroupResult( | ||
| Group group | ||
| ) { } |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/flipnote/group/application/service/FindGroupService.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,34 @@ | ||
| package flipnote.group.application.service; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| import org.springframework.stereotype.Service; | ||
|
|
||
| import flipnote.group.adapter.out.entity.GroupEntity; | ||
| import flipnote.group.adapter.out.persistence.mapper.GroupMapper; | ||
| import flipnote.group.application.port.in.FindGroupUseCase; | ||
| import flipnote.group.application.port.in.command.FindGroupCommand; | ||
| import flipnote.group.application.port.in.result.FindGroupResult; | ||
| import flipnote.group.application.port.out.GroupRepositoryPort; | ||
| import flipnote.group.domain.model.group.Group; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class FindGroupService implements FindGroupUseCase { | ||
|
|
||
| private final GroupRepositoryPort groupRepository; | ||
|
|
||
| /** | ||
| * 하나의 그룹에 대한 정보 조회 | ||
| * @param cmd | ||
| * @return | ||
| */ | ||
| @Override | ||
| public FindGroupResult findGroup(FindGroupCommand cmd) { | ||
|
|
||
| Group group = groupRepository.findById(cmd.groupId()); | ||
|
|
||
| return new FindGroupResult(group); | ||
| } | ||
| } | ||
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.