-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77f8468
commit 66d6e29
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/java/com/kusithm/hdmedi_server/domain/user/dto/request/UserAuthRequestDto.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,11 @@ | ||
package com.kusithm.hdmedi_server.domain.user.dto.request; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
public class UserAuthRequestDto { | ||
private String platform; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/kusithm/hdmedi_server/domain/user/dto/response/UserAuthResponseDto.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,22 @@ | ||
package com.kusithm.hdmedi_server.domain.user.dto.response; | ||
|
||
import com.kusithm.hdmedi_server.domain.user.domain.User; | ||
import com.kusithm.hdmedi_server.global.config.jwt.Token; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
@Getter | ||
public class UserAuthResponseDto { | ||
private String accessToken; | ||
private String refreshToken; | ||
private Long userId; | ||
|
||
public static UserAuthResponseDto of(Token token, User user) { | ||
return UserAuthResponseDto.builder() | ||
.accessToken(token.getAccessToken()) | ||
.refreshToken(token.getRefreshToken()) | ||
.userId(user.getId()) | ||
.build(); | ||
} | ||
} |