Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

[#25] 사용자 차단 목록 불러오기 기능 구현 #56

Merged
merged 6 commits into from
Mar 18, 2021

Conversation

msugo1
Copy link
Collaborator

@msugo1 msugo1 commented Mar 14, 2021

📖 Model 관련

📑 BlockUserListRequest 클래스 추가

  • 현재 사용자 아이디, 차단 목록 페이지 위치, 그리고 한 페이지에 출력할 아이디 개수의 제한 숫자를 멤버 변수로 갖는 인스턴스를 생성할 클래스 추가

📖 Controller 계층 관련

📑 BlockUserController

  • 현재 로그인 중인 사용자의 차단 사용자 목록을 불러오는 요청을 받을 getBlockUserList 메소드 추가

📖 Service 계층 관련

📑 BlockUserService

  • 현재 사용자의 차단 목록을 불러오는 비즈니스 로직을 처리할 getBlockUserList 메소드 추가

  • `@Transactional(readOnly=true)를 붙여서 Slave DB에서 내용을 읽어오도록 설정

📖 Mapper 계층 관련

📑 BlockUserMapper

  • DB에서 차단 사용자 목록을 불러 올 getBlockUserList 메소드 추가

📑 BlockUserMapper.xml

  • 위의 내용을 처리할 쿼리문 추가

📖 Util 관련

📑 Pagination

  • 차단 목록에 대한 max per page 멤버변수 추가

📖 테스트 관련

  • 포스트맨을 사용해 위의 로직 테스트

Model 관련

* BlockUserListRequest 클래스 추가

- 현재 사용자 아이디, 차단 목록 페이지 위치, 그리고 한 페이지에
  출력할 아이디 개수의 제한 숫자를 멤버 변수로 갖는 인스턴스를 생성할
  클래스 추가

Controller 계층 관련

* BlockUserController

- 현재 로그인 중인 사용자의 차단 사용자 목록을 불러오는 요청을 받을
  `getBlockUserList` 메소드 추가

Service 계층 관련

* BlockUserService

- 현재 사용자의 차단 목록을 불러오는 비즈니스 로직을 처리할
  `getBlockUserList` 메소드 추가

- `@Transactional(readOnly=true)를 붙여서 Slave DB에서 내용을 읽어오도록
  설정

Mapper 계층 관련

* BlockUserMapper

- DB에서 차단 사용자 목록을 불러 올 `getBlockUserList` 메소드 추가

* BlockUserMapper.xml

- 위의 내용을 처리할 쿼리문 추가

Util 관련

* Pagination

- 차단 목록에 대한 max per page 멤버변수 추가

테스트 관련

- 포스트맨을 사용해 위의 로직 테스트
@msugo1 msugo1 added the Help Wanted Extra attention is needed label Mar 14, 2021
@msugo1 msugo1 requested a review from f-lab-dev March 14, 2021 04:05
@msugo1 msugo1 self-assigned this Mar 14, 2021
@msugo1 msugo1 linked an issue Mar 14, 2021 that may be closed by this pull request
1 task
@msugo1
Copy link
Collaborator Author

msugo1 commented Mar 14, 2021

브랜치를 착각해서 feature/26에 푸쉬할 것을 feature/25에 해버려서 hard reset 후 push 다시 했습니다.

private final int maxPageBlockUser;

public Pagination(@Value("${friend.max.page:30}") int maxPageFriend,
@Value("${block_user.max.page:30}") int maxPageBlockUser) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이쪽 부분은 이전 리뷰에 남겨드린것처럼 페이징 계산식까지 아예 여기로 가져와서 페이징 계산용 클래스로 만들어줘도 좋겠네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 머지한다음 계산식 만들었던거 적용해서 계산용 클래스로 만들어줬습니다!

msugo1 and others added 5 commits March 17, 2021 15:10
[#23] 부하분산을 위해 마스터-슬레이브 구조로 DB변경
[#24] 사용자 차단 해제 기능 구현
1. 페이징 계산식을 별도로 분리

- 페이징을 담당하는 클래스인 pagination에 `caculateOffset` 추가

2. 스위치 문 내의 불필요한 조건 생략
- Merge branch 'feature/22' into feature/25

- `feature/22`에서구현한 페이징 계산식을 가져와서 `feature/25`에도 반영
@msugo1 msugo1 requested a review from f-lab-dev March 18, 2021 05:45
@msugo1 msugo1 merged commit 07bbcec into feature/24 Mar 18, 2021
@msugo1 msugo1 deleted the feature/25 branch March 18, 2021 15:48
@msugo1 msugo1 restored the feature/25 branch March 18, 2021 15:48
@msugo1 msugo1 deleted the feature/25 branch March 18, 2021 15:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[#25] 현재 사용자의 차단 목록을 불러올 기능 추가
2 participants