root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 1 | package entity; |
| 2 | |
Raver | 27caad7 | 2025-06-03 06:02:49 +0000 | [diff] [blame^] | 3 | import java.util.Date; |
| 4 | |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 5 | import javax.persistence.CascadeType; |
| 6 | import javax.persistence.Column; |
| 7 | import javax.persistence.Entity; |
| 8 | import javax.persistence.FetchType; |
| 9 | import javax.persistence.Id; |
| 10 | import javax.persistence.OneToOne; |
| 11 | import javax.persistence.Table; |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 12 | import javax.persistence.Temporal; |
| 13 | import javax.persistence.TemporalType; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 14 | import javax.persistence.Transient; |
Raver | 27caad7 | 2025-06-03 06:02:49 +0000 | [diff] [blame^] | 15 | |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 16 | import com.querydsl.core.annotations.QueryEntity; |
| 17 | |
| 18 | @QueryEntity |
root | 33a7d95 | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 19 | @Entity(name = "User") |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 20 | @Table(name = "User") |
| 21 | public class User { |
| 22 | @Id |
| 23 | @Column(name = "user_id", length = 36, nullable = false) |
root | f35409f | 2025-05-19 04:41:57 +0000 | [diff] [blame] | 24 | public String userid; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 25 | @Column(name = "email", nullable = false, length = 255, unique = true) |
root | f35409f | 2025-05-19 04:41:57 +0000 | [diff] [blame] | 26 | public String email; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 27 | @Column(name = "username", length = 100, nullable = false) |
| 28 | public String username; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 29 | @Column(name = "password", length = 255, nullable = false) |
| 30 | public String password; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 31 | @Column(name = "gender", nullable = false) |
| 32 | public String sex; |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 33 | |
| 34 | @Column(name = "detectedCount", nullable = false) |
| 35 | public int detectedCount = 0; |
| 36 | |
| 37 | @Temporal(TemporalType.TIMESTAMP) |
956303669 | 3730053 | 2025-06-02 14:43:06 +0800 | [diff] [blame] | 38 | @Column(name = "lastDetectedTime", nullable = false) |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 39 | public Date lastDetectedTime = new Date(); |
| 40 | |
| 41 | @Column(name = "fake_detected_count", nullable = false) |
| 42 | public int fakeDetectedCount = 0; |
| 43 | |
| 44 | @Temporal(TemporalType.TIMESTAMP) |
| 45 | @Column(name = "fake_last_detected_time", nullable = false) |
| 46 | public Date fakeLastDetectedTime = new Date(); |
| 47 | |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 48 | @Transient |
| 49 | public String age; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 50 | @Column(name = "school") |
| 51 | public String school; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 52 | @Column(name = "avatar_url") |
| 53 | public String pictureurl; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 54 | @Column(name = "bio") |
| 55 | public String profile; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 56 | @Column(name = "account_status", nullable = false) |
| 57 | public boolean accountstate; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 58 | @Column(name = "invite_left", nullable = false) |
| 59 | public int invitetimes; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 60 | @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false) |
| 61 | public UserPT userPT; |
| 62 | |
| 63 | // Constructors, getters, setters |
root | 33a7d95 | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 64 | public User() { |
| 65 | } |
| 66 | } |