Skip to content

Commit

Permalink
✨ [feat] SOPT-all#7 Token 관련 클래스 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
choyeongju committed Jan 7, 2025
1 parent db650e9 commit ab357f8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/com/sopt/bbangzip/domain/token/entity/Token.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.sopt.bbangzip.domain.token.entity;

import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;

@Getter
@RedisHash(value="token", timeToLive = 60 * 60 * 24 * 14)
@NoArgsConstructor(access= AccessLevel.PROTECTED)
public class Token {

@Id
private Long id;

@Indexed
private String refreshToken;

@Builder
public Token(Long id, String refreshToken) {
this.id = id;
this.refreshToken = refreshToken;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.sopt.bbangzip.domain.token.repository;

import com.sopt.bbangzip.domain.token.entity.Token;
import org.springframework.data.repository.CrudRepository;

public interface TokenRepository extends CrudRepository<Token, Long> {
}

0 comments on commit ab357f8

Please sign in to comment.