feat : 유저등급별 페이지 및 관리자 페이지 API 설계(SJB-step2)#3
Open
sjb7773 wants to merge 3 commits intoPoolC:develop-SJBfrom
Open
feat : 유저등급별 페이지 및 관리자 페이지 API 설계(SJB-step2)#3sjb7773 wants to merge 3 commits intoPoolC:develop-SJBfrom
sjb7773 wants to merge 3 commits intoPoolC:develop-SJBfrom
Conversation
VSFe
requested changes
May 26, 2023
|
|
||
|
|
||
| public List<Member> findMembers() { | ||
| return memberRepository.findAll(); |
Member
There was a problem hiding this comment.
어떤 추가적인 Validation 작업이 필요할 수도 있지 않을까요?
(데이터가 없다거나, 조회가 불가능한 권한이 있다거나...)
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| public interface MemberRepository { |
Member
There was a problem hiding this comment.
개발하는 입장에서, 사실 메모리/JPA를 나눌 필요가 있나 싶어요.
이후 다른 스텝 할 때도 두개 다 하기 힘드니까, 그냥 하나만 하세요 ㅋㅋㅋ
| return Arrays.stream(request.getCookies()) | ||
| .filter(cookie -> cookie.getName().equals(cookieName)) | ||
| .findAny() | ||
| .orElse(null); |
Member
There was a problem hiding this comment.
어디에서는 Optional을 쓰고, 어디에서는 null을 쓰는데, 사실 하나로 로직을 통합하는게 나을 것 같아요.
|
|
||
| //if-else문의 문제점 존재 -> 더 나은 방식 없을까? | ||
| public String RoleDistributor(MEMBER_ROLE member_role) { | ||
| if (member_role == MEMBER_ROLE.ROLE_ADMIN) { |
Member
There was a problem hiding this comment.
Switch 방식으로 변경하시거나, enum안에 property를 넣고 그 값을 반환하는 방식으로 처리해 주세요.
| public String acceptRoleChange(@RequestParam("memberId") String memberId, | ||
| @RequestParam("member_role") MEMBER_ROLE member_role) { | ||
| System.out.println("memberId = " + memberId); | ||
| System.out.println("member_role = " + member_role); |
Member
There was a problem hiding this comment.
System.out.println 은 좋지 않아요.
로거로 바꿔주세요.
Author
|
넵 확인했습니다! 감사합니다 ㅎㅎ |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filter를 사용한 로그인 회원 체크 로직 리팩터링
RoleMypageController와 MEMER_ROLE enum domain을 통한 유저 등급별 접근 페이지 설계
Filter를 사용한 관리자 페이지 설정 및 관리자 페이지에서 유저 등급 권한 조작 가능
IntelliJ Actions On Save기능을 사용한 코드 스타일 정리