Skip to content

Commit

Permalink
[#37] refactor: 외부 http 응답 dto record로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyu0218 committed Feb 3, 2025
1 parent 0dd6a2b commit 64b398d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,11 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class KakaoTokenResponse {

@JsonProperty("token_type")
private String tokenType;

@JsonProperty("access_token")
private String accessToken;

@JsonProperty("expires_in")
private Integer expiresIn;

@JsonProperty("refresh_token")
private String refreshToken;

@JsonProperty("refresh_token_expires_in")
private Integer refreshTokenExpiresIn;
}
public record KakaoTokenResponse(
@JsonProperty("token_type") String tokenType,
@JsonProperty("access_token") String accessToken,
@JsonProperty("expires_in") Integer expiresIn,
@JsonProperty("refresh_token") String refreshToken,
@JsonProperty("refresh_token_expires_in") Integer refreshTokenExpiresIn) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class KakaoUserInfoResponse {
public record KakaoUserInfoResponse(
@JsonProperty("id") Long id, @JsonProperty("kakao_account") KakaoAccount kakaoAccount) {

@JsonProperty("id")
Long id;
@JsonIgnoreProperties(ignoreUnknown = true)
public record KakaoAccount(
@JsonProperty("name") String name, @JsonProperty("email") String email) {}
}

0 comments on commit 64b398d

Please sign in to comment.