This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
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.
Model 관련 * BlockUserListRequest 클래스 추가 - 현재 사용자 아이디, 차단 목록 페이지 위치, 그리고 한 페이지에 출력할 아이디 개수의 제한 숫자를 멤버 변수로 갖는 인스턴스를 생성할 클래스 추가 Controller 계층 관련 * BlockUserController - 현재 로그인 중인 사용자의 차단 사용자 목록을 불러오는 요청을 받을 `getBlockUserList` 메소드 추가 Service 계층 관련 * BlockUserService - 현재 사용자의 차단 목록을 불러오는 비즈니스 로직을 처리할 `getBlockUserList` 메소드 추가 - `@Transactional(readOnly=true)를 붙여서 Slave DB에서 내용을 읽어오도록 설정 Mapper 계층 관련 * BlockUserMapper - DB에서 차단 사용자 목록을 불러 올 `getBlockUserList` 메소드 추가 * BlockUserMapper.xml - 위의 내용을 처리할 쿼리문 추가 Util 관련 * Pagination - 차단 목록에 대한 max per page 멤버변수 추가 테스트 관련 - 포스트맨을 사용해 위의 로직 테스트
- Loading branch information
msugo1
committed
Mar 14, 2021
1 parent
6234157
commit d84e4dc
Showing
6 changed files
with
65 additions
and
5 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
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
25 changes: 25 additions & 0 deletions
25
src/main/java/me/soo/helloworld/model/blockuser/BlockUserListRequest.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,25 @@ | ||
package me.soo.helloworld.model.blockuser; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import me.soo.helloworld.util.Pagination; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
public class BlockUserListRequest { | ||
|
||
private final String userId; | ||
|
||
private final int offset; | ||
|
||
private final int limit; | ||
|
||
static public BlockUserListRequest create(String userId, int pageNumber, Pagination pagination) { | ||
|
||
return BlockUserListRequest.builder() | ||
.userId(userId) | ||
.offset(pagination.getMaxPageBlockUser() * (Math.max(pageNumber, 1) - 1)) | ||
.limit(pagination.getMaxPageBlockUser()) | ||
.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
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