-
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
[#25] 회원 가입, 로그인 API개발 #27
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.
@GaHee99
가희님 코드 작성하느라 수고하셨습니다!
개행과 git actions 상에 에러 부분 확인 다시 한번 확인해주세요!
|
||
@FeignClient(name = "kakaoApiClient", url = "https://kapi.kakao.com") | ||
public interface KakaoApiClient { | ||
@GetMapping(value = "/v2/user/me") |
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.
p3
클래스나, 인터페이스 명 뒤에는 한줄 띄워주세요~
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class KakaoUserResponse { | ||
private Long id; |
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.
P3
여기도요~
@Getter | ||
@Configuration | ||
public class AuthConfig { | ||
@Value("${jwt.secret}") |
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.
p3
여기도 개행 해주세요~
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class UserLoginRequest { | ||
private String token; |
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.
p3
여기도 개행 해주세요~
import com.eodya.api.common.exception.ExceptionCode; | ||
|
||
public class AuthException extends BusinessException { | ||
public AuthException(ExceptionCode exceptionCode, Object... rejectedValues) { |
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.
p3
여기도요~
@Getter | ||
@RequiredArgsConstructor | ||
public enum AuthExceptionCode implements ExceptionCode { | ||
INVALID_KAKAO_TOKEN(HttpStatus.BAD_REQUEST, "AUT-001", "유효한 카카오 토큰이 아닙니다."), |
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.
p3
해당 부분도 개행 체크해주세요~
import com.eodya.api.common.exception.ExceptionCode; | ||
|
||
public class UserException extends BusinessException { | ||
public UserException(ExceptionCode exceptionCode, Object... rejectedValues) { |
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.
p3
해당 부분도 개행해주세요~
@Getter | ||
@RequiredArgsConstructor | ||
public enum UserExceptionCode implements ExceptionCode { | ||
USER_NOT_FOUND(HttpStatus.NOT_FOUND, "USE-001", "해당하는 유저를 찾을 수 없음"), |
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.
p3: 개행 해주세요~
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface UserRepository extends JpaRepository<User, Long> { | ||
Optional<User> findByOAuthId(String oauthId); |
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.
p3
해당 부분도 개행 해주세요~
package com.eodya.api.users.service; | ||
|
||
public interface SocialService { | ||
String getOAuthId(String token); |
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.
p3: 개행 해주세요~
👨💻 작업 사항
📑 PR 개요
✅ 작업 목록
🙏 리뷰어에게
Feign client를 도입하여 kakao API와 통신했습니다.
유효하지 않은 kakao token 일 경우, AuException을 터뜨리도록 로직을 구성했습니다.
User엔티티에서 OAuthProvider를 enum타입으로 선언했습니다.
jwt 토큰을 도입하여 loing 로직을 구현했습니다.
현재 Exception이 발생했을 때, 코드만 보여주고 있는데 이부분 확인해주시면 감사하겠습니다.
kakao API부분을 현재 external 패키지에 선언했는데, 폴더링 관련해서는 금요일 이후에 다시 얘기 나눠보면 좋을 것 같아요
기타
Closes 회원 가입, 로그인 API개발 #25
Prefix
P1
: 꼭 반영해주세요 (Request changes)P2
: 적극적으로 고려해주세요 (Request changes)P3
: 웬만하면 반영해 주세요 (Comment)P4
: 반영해도 좋고 넘어가도 좋습니다 (Approve)P5
: 그냥 사소한 의견입니다 (Approve)