-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement getMemberByKeywordForSharedAlbum in member service
- Loading branch information
1 parent
75f7498
commit 412eae1
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
user-service/src/main/java/kr/mafoo/user/controller/dto/response/MemberDetailResponse.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,42 @@ | ||
package kr.mafoo.user.controller.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import kr.mafoo.user.service.dto.MemberDetailDto; | ||
|
||
@Schema(description = "사용자의 정보 응답") | ||
public record MemberDetailResponse( | ||
@Schema(description = "사용자 ID", example = "test") | ||
String memberId, | ||
|
||
@Schema(description = "사용자 이름", example = "송영민") | ||
String name, | ||
|
||
@Schema(description = "프로필 이미지 URL", example = "https://mafoo.kr/profile.jpg") | ||
String profileImageUrl, | ||
|
||
@Schema(description = "식별 번호", example = "0000") | ||
String serialNumber, | ||
|
||
@Schema(description = "공유 사용자 ID", example = "test_shared_member_id") | ||
String sharedMemberId, | ||
|
||
@Schema(description = "공유 상태", example = "PENDING") | ||
String shareStatus, | ||
|
||
@Schema(description = "권한 단계", example = "FULL_ACCESS") | ||
String permissionLevel | ||
) { | ||
public static MemberDetailResponse fromDto( | ||
MemberDetailDto dto | ||
) { | ||
return new MemberDetailResponse( | ||
dto.memberId(), | ||
dto.name(), | ||
dto.profileImageUrl(), | ||
dto.serialNumber(), | ||
dto.sharedMemberId(), | ||
dto.shareStatus(), | ||
dto.permissionLevel() | ||
); | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
user-service/src/main/java/kr/mafoo/user/service/dto/MemberDetailDto.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,28 @@ | ||
package kr.mafoo.user.service.dto; | ||
|
||
import kr.mafoo.user.domain.MemberEntity; | ||
|
||
public record MemberDetailDto( | ||
String memberId, | ||
String name, | ||
String profileImageUrl, | ||
String serialNumber, | ||
String sharedMemberId, | ||
String shareStatus, | ||
String permissionLevel | ||
) { | ||
public static MemberDetailDto fromSharedMember( | ||
MemberEntity memberEntity, | ||
SharedMemberDto sharedMemberDto | ||
) { | ||
return new MemberDetailDto( | ||
memberEntity.getId(), | ||
memberEntity.getName(), | ||
memberEntity.getProfileImageUrl(), | ||
String.format("%04d", memberEntity.getSerialNumber()), | ||
sharedMemberDto.sharedMemberId(), | ||
sharedMemberDto.shareStatus(), | ||
sharedMemberDto.permissionLevel() | ||
); | ||
} | ||
} |