22301138 | 5e9c35a | 2025-06-04 15:52:45 +0800 | [diff] [blame] | 1 | package com.example.myproject.entity; |
| 2 | |
| 3 | import javax.persistence.*; |
| 4 | import java.time.LocalDateTime; |
| 5 | |
| 6 | @Entity |
| 7 | @Table(name = "user_invite_code") |
| 8 | public class UserInviteCode { |
| 9 | |
| 10 | @Id |
| 11 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 12 | @Column(name = "invite_id") |
| 13 | private Long inviteId; |
| 14 | |
| 15 | @Column(name = "user_id", nullable = false) |
| 16 | private Long userId; |
| 17 | |
| 18 | @Column(name = "invite_code", nullable = false, unique = true) |
| 19 | private String inviteCode; |
| 20 | |
| 21 | @Column(name = "is_used", nullable = false) |
| 22 | private Boolean isUsed = false; |
| 23 | |
| 24 | @Column(name = "created_at", nullable = false) |
| 25 | private LocalDateTime createdAt; |
| 26 | |
| 27 | // Getters and Setters |
| 28 | public Long getInviteId() { |
| 29 | return inviteId; |
| 30 | } |
| 31 | |
| 32 | public void setInviteId(Long inviteId) { |
| 33 | this.inviteId = inviteId; |
| 34 | } |
| 35 | |
| 36 | public Long getUserId() { |
| 37 | return userId; |
| 38 | } |
| 39 | |
| 40 | public void setUserId(Long userId) { |
| 41 | this.userId = userId; |
| 42 | } |
| 43 | |
| 44 | public String getInviteCode() { |
| 45 | return inviteCode; |
| 46 | } |
| 47 | |
| 48 | public void setInviteCode(String inviteCode) { |
| 49 | this.inviteCode = inviteCode; |
| 50 | } |
| 51 | |
| 52 | public Boolean getIsUsed() { |
| 53 | return isUsed; |
| 54 | } |
| 55 | |
| 56 | public void setIsUsed(Boolean isUsed) { |
| 57 | this.isUsed = isUsed; |
| 58 | } |
| 59 | |
| 60 | public LocalDateTime getCreatedAt() { |
| 61 | return createdAt; |
| 62 | } |
| 63 | |
| 64 | public void setCreatedAt(LocalDateTime createdAt) { |
| 65 | this.createdAt = createdAt; |
| 66 | } |
| 67 | } |