-
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 #53 from Gamegoo-repo/feat/49
[Feat/49] ์ฐจ๋จํ ํ์ ๋ชฉ๋ก ์กฐํ API ๊ตฌํ
- Loading branch information
Showing
8 changed files
with
134 additions
and
6 deletions.
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/gamegoo/apiPayload/exception/handler/PageHandler.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,10 @@ | ||
package com.gamegoo.apiPayload.exception.handler; | ||
|
||
import com.gamegoo.apiPayload.code.BaseErrorCode; | ||
import com.gamegoo.apiPayload.exception.GeneralException; | ||
|
||
public class PageHandler extends GeneralException { | ||
public PageHandler(BaseErrorCode code) { | ||
super(code); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.gamegoo.converter; | ||
|
||
import com.gamegoo.domain.Member; | ||
import com.gamegoo.dto.member.MemberResponse; | ||
import org.springframework.data.domain.Page; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class MemberConverter { | ||
|
||
public static MemberResponse.blockListDto toBlockListDto(Page<Member> blockList) { | ||
List<MemberResponse.blockedMemberDto> blockedMemberDtoList = blockList.stream() | ||
.map(MemberConverter::toBlockedMemberDto) | ||
.collect(Collectors.toList()); | ||
|
||
return MemberResponse.blockListDto.builder() | ||
.blockedMemberDtoList(blockedMemberDtoList) | ||
.listSize(blockedMemberDtoList.size()) | ||
.totalPage(blockList.getTotalPages()) | ||
.totalElements(blockList.getTotalElements()) | ||
.isFirst(blockList.isFirst()) | ||
.isLast(blockList.isLast()) | ||
.build(); | ||
} | ||
|
||
public static MemberResponse.blockedMemberDto toBlockedMemberDto(Member membr) { | ||
return MemberResponse.blockedMemberDto.builder() | ||
.memberId(membr.getId()) | ||
.profileImg(membr.getProfileImage()) | ||
.email(membr.getEmail()) | ||
.name(membr.getGameuserName()) | ||
.build(); | ||
} | ||
} |
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,34 @@ | ||
package com.gamegoo.dto.member; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
public class MemberResponse { | ||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class blockListDto { | ||
List<blockedMemberDto> blockedMemberDtoList; | ||
Integer listSize; | ||
Integer totalPage; | ||
Long totalElements; | ||
Boolean isFirst; | ||
Boolean isLast; | ||
} | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class blockedMemberDto { | ||
Long memberId; | ||
String profileImg; | ||
String email; | ||
String name; | ||
} | ||
} |
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