Skip to content

Commit 2696912

Browse files
committed
feat: 소셜 로그인용 DTO 추가
1 parent 42f77e5 commit 2696912

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.back.web7_9_codecrete_be.domain.auth.dto.kakao;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import lombok.Getter;
5+
6+
@Getter
7+
public class KakaoTokenResponse {
8+
9+
@JsonProperty("access_token")
10+
private String accessToken;
11+
12+
@JsonProperty("expires_in")
13+
private int expiresIn;
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.back.web7_9_codecrete_be.domain.auth.dto.kakao;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Getter;
5+
6+
@Getter
7+
@AllArgsConstructor
8+
public class KakaoUserInfo {
9+
private String socialId;
10+
private String email;
11+
private String nickname;
12+
private String profileImageUrl;
13+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.back.web7_9_codecrete_be.domain.auth.dto.kakao;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import lombok.Getter;
5+
6+
@Getter
7+
public class KakaoUserResponse {
8+
9+
private Long id;
10+
11+
@JsonProperty("kakao_account")
12+
private KakaoAccount kakaoAccount;
13+
14+
public KakaoUserInfo toUserInfo() {
15+
return new KakaoUserInfo(
16+
String.valueOf(id),
17+
kakaoAccount.getEmail(),
18+
kakaoAccount.getProfile().getNickname(),
19+
kakaoAccount.getProfile().getProfileImageUrl()
20+
);
21+
}
22+
23+
@Getter
24+
public static class KakaoAccount {
25+
private String email;
26+
private Profile profile;
27+
}
28+
29+
@Getter
30+
public static class Profile {
31+
private String nickname;
32+
33+
@JsonProperty("profile_image_url")
34+
private String profileImageUrl;
35+
}
36+
}

0 commit comments

Comments
 (0)