-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from Princess-in-silvertown/feat/78
Feat: μ μ νλ‘ν μ‘°ν νμ¬λ μμ±
- Loading branch information
Showing
7 changed files
with
66 additions
and
25 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/slvtwn/khu/toyouserver/application/UserProfileFacade.java
This file contains 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 slvtwn.khu.toyouserver.application; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import slvtwn.khu.toyouserver.dto.GroupResponse; | ||
import slvtwn.khu.toyouserver.dto.UserProfileResponse; | ||
import slvtwn.khu.toyouserver.dto.UserResponse; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class UserProfileFacade { | ||
|
||
private final UserService userService; | ||
private final GroupService groupService; | ||
|
||
@Transactional(readOnly = true) | ||
public UserProfileResponse getProfile(Long userId) { | ||
UserResponse userResponse = userService.getProfile(userId); | ||
List<GroupResponse> groupResponses = groupService.findRegisteredGroupsByUser(userId); | ||
|
||
return new UserProfileResponse(userResponse.id(), userResponse.birthday(), userResponse.name(), | ||
userResponse.introduction(), userResponse.imageUrl(), groupResponses); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/slvtwn/khu/toyouserver/dto/UserProfileResponse.java
This file contains 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,9 @@ | ||
package slvtwn.khu.toyouserver.dto; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
public record UserProfileResponse(Long id, LocalDate birthday, String name, String introduction, | ||
String imageUrl, List<GroupResponse> groups) { | ||
|
||
} |
This file contains 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 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 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 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 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