blob: f4c64bf8dd68c6dafd8e06b0441fec050ec17761 [file] [log] [blame]
rootff0769a2025-05-18 17:24:41 +00001package entity;
2
Raver27caad72025-06-03 06:02:49 +00003import java.util.Date;
4
rootff0769a2025-05-18 17:24:41 +00005import javax.persistence.CascadeType;
6import javax.persistence.Column;
7import javax.persistence.Entity;
8import javax.persistence.FetchType;
9import javax.persistence.Id;
10import javax.persistence.OneToOne;
11import javax.persistence.Table;
Raver5ba779f2025-05-14 12:48:12 +000012import javax.persistence.Temporal;
13import javax.persistence.TemporalType;
rootff0769a2025-05-18 17:24:41 +000014import javax.persistence.Transient;
Raver27caad72025-06-03 06:02:49 +000015
rhjc6a4ee02025-06-06 00:45:18 +080016import com.fasterxml.jackson.annotation.JsonProperty;
rootff0769a2025-05-18 17:24:41 +000017import com.querydsl.core.annotations.QueryEntity;
18
19@QueryEntity
root33a7d952025-05-18 17:24:41 +000020@Entity(name = "User")
rootff0769a2025-05-18 17:24:41 +000021@Table(name = "User")
22public class User {
23 @Id
24 @Column(name = "user_id", length = 36, nullable = false)
rootf35409f2025-05-19 04:41:57 +000025 public String userid;
rootff0769a2025-05-18 17:24:41 +000026 @Column(name = "email", nullable = false, length = 255, unique = true)
rootf35409f2025-05-19 04:41:57 +000027 public String email;
rootff0769a2025-05-18 17:24:41 +000028 @Column(name = "username", length = 100, nullable = false)
29 public String username;
rootff0769a2025-05-18 17:24:41 +000030 @Column(name = "password", length = 255, nullable = false)
31 public String password;
rhj46f62c42025-06-06 23:24:10 +080032 @Column(name = "gender")
rhjc6a4ee02025-06-06 00:45:18 +080033 @JsonProperty("gender")
rootff0769a2025-05-18 17:24:41 +000034 public String sex;
Raver5ba779f2025-05-14 12:48:12 +000035
36 @Column(name = "detectedCount", nullable = false)
37 public int detectedCount = 0;
38
39 @Temporal(TemporalType.TIMESTAMP)
95630366937300532025-06-02 14:43:06 +080040 @Column(name = "lastDetectedTime", nullable = false)
Raver5ba779f2025-05-14 12:48:12 +000041 public Date lastDetectedTime = new Date();
42
43 @Column(name = "fake_detected_count", nullable = false)
44 public int fakeDetectedCount = 0;
45
46 @Temporal(TemporalType.TIMESTAMP)
47 @Column(name = "fake_last_detected_time", nullable = false)
48 public Date fakeLastDetectedTime = new Date();
49
rootff0769a2025-05-18 17:24:41 +000050 @Transient
51 public String age;
rootff0769a2025-05-18 17:24:41 +000052 @Column(name = "school")
53 public String school;
rootff0769a2025-05-18 17:24:41 +000054 @Column(name = "avatar_url")
rhjc6a4ee02025-06-06 00:45:18 +080055 @JsonProperty("avatar_url")
rootff0769a2025-05-18 17:24:41 +000056 public String pictureurl;
rootff0769a2025-05-18 17:24:41 +000057 @Column(name = "bio")
58 public String profile;
rootff0769a2025-05-18 17:24:41 +000059 @Column(name = "account_status", nullable = false)
rhjc6a4ee02025-06-06 00:45:18 +080060 @JsonProperty("account_status")
rootff0769a2025-05-18 17:24:41 +000061 public boolean accountstate;
rootff0769a2025-05-18 17:24:41 +000062 @Column(name = "invite_left", nullable = false)
rhjc6a4ee02025-06-06 00:45:18 +080063 @JsonProperty("invite_left")
rootff0769a2025-05-18 17:24:41 +000064 public int invitetimes;
rhj46f62c42025-06-06 23:24:10 +080065 // @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false)
66 // public UserPT userPT;
rootff0769a2025-05-18 17:24:41 +000067
68 // Constructors, getters, setters
root33a7d952025-05-18 17:24:41 +000069 public User() {
70 }
71}