-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 로그인 응답에 데이터 추가, Response 생성 방식 캡슐화 - 카카오 닉네임, 프로필 이미지 경로 * refactor: RestClient 예외 처리 작성 * feat: 서버 내부 에러 처리 핸들러 작성 * feat: Swagger api 정보 추가 * fix: 최상위 예외 처리 코드 제거 개선
- Loading branch information
Showing
6 changed files
with
61 additions
and
3 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
12 changes: 11 additions & 1 deletion
12
backend/src/main/java/woowacourse/touroot/authentication/dto/LoginResponse.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 |
---|---|---|
@@ -1,4 +1,14 @@ | ||
package woowacourse.touroot.authentication.dto; | ||
|
||
public record LoginResponse(String accessToken) { | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import woowacourse.touroot.member.domain.Member; | ||
|
||
public record LoginResponse( | ||
@Schema(description = "로그인된 유저의 닉네임") String nickname, | ||
@Schema(description = "로그인된 유저의 프로필 이미지 경로") String profileImageUrl, | ||
@Schema(description = "인가에 필요한 accessToken") String accessToken) { | ||
|
||
public static LoginResponse of(Member member, String accessToken) { | ||
return new LoginResponse(member.getNickname(), member.getProfileImageUri(), accessToken); | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
backend/src/main/java/woowacourse/touroot/global/exception/ClientException.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,8 @@ | ||
package woowacourse.touroot.global.exception; | ||
|
||
public class ClientException extends RuntimeException { | ||
|
||
public ClientException(String message) { | ||
super(message); | ||
} | ||
} |
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