-
Notifications
You must be signed in to change notification settings - Fork 1
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
192c1d7
commit 6887d64
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
week02/seminar/demo/src/main/java/com/example/demo/auth/redis/domain/Token.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,32 @@ | ||
package com.example.demo.auth.redis.domain; | ||
|
||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.data.redis.core.RedisHash; | ||
import org.springframework.data.redis.core.index.Indexed; | ||
|
||
@RedisHash(value = "", timeToLive = 60 * 60 * 24 * 1000L * 14) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
@Builder | ||
public class Token { | ||
|
||
@Id | ||
private Long id; | ||
|
||
@Indexed | ||
private String refreshToken; | ||
|
||
public static Token of( | ||
final Long id, | ||
final String refreshToken | ||
) { | ||
return Token.builder() | ||
.id(id) | ||
.refreshToken(refreshToken) | ||
.build(); | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...inar/demo/src/main/java/com/example/demo/service/dto/member/RegenerateAccessTokenDto.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,12 @@ | ||
package com.example.demo.service.dto.member; | ||
|
||
public record RegenerateAccessTokenDto( | ||
String accessToken | ||
) { | ||
public static RegenerateAccessTokenDto of( | ||
String accessToken | ||
|
||
) { | ||
return new RegenerateAccessTokenDto(accessToken); | ||
} | ||
} |