-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/47 회원 API리팩토링 #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다👍
@@ -37,8 +37,9 @@ public AuthenticationManager authenticationManager(AuthenticationConfiguration c | |||
|
|||
@Bean | |||
public JWTFilter jwtFilter() { | |||
List<String> excludedPaths = Arrays.asList("/swagger-ui/", "/v3/api-docs", "/api/member/join/local", "/api/member/login/local", "/api/member/email"); | |||
return new JWTFilter(jwtUtil, excludedPaths); | |||
List<String> excludedPaths = Arrays.asList("/api/member/join", "/api/member/login", "/api/member/email"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/swagger-ui/", "/v3/api-docs" 이 uri도 다시 추가 부탁드립니다..! dev랑 충돌 해결하면서 지워진 것 같아요
.authorizeHttpRequests((auth) -> auth | ||
.antMatchers("/api/member/join/local", "/api/member/login/local", "/api/member/email").permitAll() | ||
.antMatchers("/", "/swagger-ui/**", "/v3/api-docs/**").permitAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분도 다시 추가 부탁드려요!
Set<String> requestedGameStyles = new HashSet<>(gameStyles); | ||
|
||
// 현재 사용자의 모든 MemberGameStyle을 가져옴 | ||
List<MemberGameStyle> existingMemberGameStyles = memberGameStyleRepository.findByMember(member); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository를 거치지 않고도 member.getMemberGameStyleList()로 해당 member의 모든 MemberGameStyple 리스트를 얻을 수 있습니다 (JPA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 패키지 구조 변경 때문에, MemberController 파일에 5번째 줄
import com.gamegoo.security.SecurityUtil;
을
import com.gamegoo.util.SecurityUtil;
로 변경 부탁드려요..!
|
||
@PutMapping("/gamestyle") | ||
@Operation(summary = "gamestyle 추가 및 수정 API 입니다.", description = "API for Gamestyle addition and modification ") | ||
public ApiResponse<Object> addGameStyle(@RequestBody GameStyleDTO gameStyleDTO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 api 관련 리뷰는 노션 참고해주세요..! 노션 백엔드>Pages>PR#50
@Operation(summary = "회원가입 API 입니다.", description = "API for join") | ||
public ApiResponse<Object> joinMember(@RequestBody JoinDTO joinDTO) { | ||
authService.joinMember(joinDTO); | ||
return ApiResponse.onSuccess("회원가입에 성공했습니다."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 가입된 회원에 대한 정보(id, email)등을 응답으로 주는 것도 좋을 것 같아요..!
|
||
@PostMapping("/email/send") | ||
@Operation(summary = "이메일 인증코드 전송 API 입니다.", description = "API for sending email") | ||
public ApiResponse<Object> sendEmail(@RequestBody EmailDTO emailDTO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
응답을 단순 string으로 줄 때는 여기도 ApiResponse으로 지정해주는 게 더 좋을 것 같아요!
public void modifyPosition(int mainP, int subP) { | ||
Long userId = SecurityUtil.getCurrentUserId(); | ||
|
||
// 만약 mainP, subP 가 1~5의 값이 아닐 경우 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
노션 참고 부탁드려요!
@@ -0,0 +1,46 @@ | |||
package com.gamegoo.apiPayload.exception.handler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 filter는 apiPayload.exception.handler 패키지보다 그냥 com.gamegoo.filter 패키지에 있는게 찾기 편할 것 같아요!
|
||
public UserDetails loadUserById(Long id) throws UsernameNotFoundException { | ||
Member member = memberRepository.findById(id) | ||
.filter(m -> !m.getBlind()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
🚀 개요
회원 API 예외처리 및 리팩토링
🔍 변경사항
⏳ 작업 내용
📝 논의사항