| package com.example.myproject.entity; |
| |
| import javax.persistence.*; |
| import java.time.LocalDateTime; |
| |
| @Entity |
| @Table(name = "user_invite_code") |
| public class UserInviteCode { |
| |
| @Id |
| @GeneratedValue(strategy = GenerationType.IDENTITY) |
| @Column(name = "invite_id") |
| private Long inviteId; |
| |
| @Column(name = "user_id", nullable = false) |
| private Long userId; |
| |
| @Column(name = "invite_code", nullable = false, unique = true) |
| private String inviteCode; |
| |
| @Column(name = "is_used", nullable = false) |
| private Boolean isUsed = false; |
| |
| @Column(name = "created_at", nullable = false) |
| private LocalDateTime createdAt; |
| |
| // Getters and Setters |
| public Long getInviteId() { |
| return inviteId; |
| } |
| |
| public void setInviteId(Long inviteId) { |
| this.inviteId = inviteId; |
| } |
| |
| public Long getUserId() { |
| return userId; |
| } |
| |
| public void setUserId(Long userId) { |
| this.userId = userId; |
| } |
| |
| public String getInviteCode() { |
| return inviteCode; |
| } |
| |
| public void setInviteCode(String inviteCode) { |
| this.inviteCode = inviteCode; |
| } |
| |
| public Boolean getIsUsed() { |
| return isUsed; |
| } |
| |
| public void setIsUsed(Boolean isUsed) { |
| this.isUsed = isUsed; |
| } |
| |
| public LocalDateTime getCreatedAt() { |
| return createdAt; |
| } |
| |
| public void setCreatedAt(LocalDateTime createdAt) { |
| this.createdAt = createdAt; |
| } |
| } |