Skip to content

Commit

Permalink
SCRUM-48 feat: Token 클래스 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
yeopyeop-82 committed Aug 12, 2024
1 parent 75693fb commit 44cba9d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/main/java/com/kakaoteck/golagola/security/token/Token.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
package com.kakaoteck.golagola.security.token;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.kakaoteck.golagola.domain.buyer.entity.Buyer;
import com.kakaoteck.golagola.domain.seller.entity.Seller;
import com.kakaoteck.golagola.security.token.enums.TokenType;
import jakarta.persistence.*;
import lombok.*;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "token")
public class Token {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(unique = true)
private String token;

@Enumerated(EnumType.STRING)
private TokenType tokenType = TokenType.BEARER;

private boolean revoked;

private boolean expired;

@JsonIgnore
@ToString.Exclude
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "buyer_id")
private Buyer buyer;

@JsonIgnore
@ToString.Exclude
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "seller_id")
private Seller seller;

}

0 comments on commit 44cba9d

Please sign in to comment.