mirror of
https://github.com/cekis/swg-api
synced 2026-01-16 19:05:10 -05:00
128 lines
2.3 KiB
Java
128 lines
2.3 KiB
Java
package swg.entity;
|
|
|
|
import org.hibernate.annotations.ColumnDefault;
|
|
import org.hibernate.annotations.CreationTimestamp;
|
|
|
|
import javax.persistence.*;
|
|
import javax.validation.constraints.*;
|
|
import java.sql.Timestamp;
|
|
|
|
@Entity
|
|
@Table(name = "UAS_USERS",
|
|
uniqueConstraints = {
|
|
@UniqueConstraint(columnNames = "USERNAME"),
|
|
@UniqueConstraint(columnNames = "EMAIL")
|
|
})
|
|
public class UasUser {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@NotBlank
|
|
@Size(max = 20)
|
|
private String username;
|
|
|
|
@NotBlank
|
|
@Size(max = 50)
|
|
@Email
|
|
private String email;
|
|
|
|
@NotBlank
|
|
@Size(max = 120)
|
|
private String password;
|
|
|
|
@NotBlank
|
|
@Enumerated(EnumType.STRING)
|
|
private UserRole userrole;
|
|
|
|
@Column(name = "CREATED")
|
|
@NotBlank
|
|
@CreationTimestamp
|
|
private Timestamp createdTime;
|
|
|
|
@Column(name = "GOD_LEVEL")
|
|
@ColumnDefault("0")
|
|
@NotBlank
|
|
@Min(0)
|
|
@Max(100)
|
|
private int godLevel;
|
|
|
|
@Column(name = "STATION_ID")
|
|
private long stationId;
|
|
|
|
public UasUser() {
|
|
}
|
|
|
|
public UasUser(String username, String email, String password) {
|
|
this.username = username;
|
|
this.email = email;
|
|
this.password = password;
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getUsername() {
|
|
return username;
|
|
}
|
|
|
|
public void setUsername(String username) {
|
|
this.username = username;
|
|
}
|
|
|
|
public String getEmail() {
|
|
return email;
|
|
}
|
|
|
|
public void setEmail(String email) {
|
|
this.email = email;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
public UserRole getUserRole() {
|
|
return userrole;
|
|
}
|
|
|
|
public void setUserRole(UserRole userRole) {
|
|
this.userrole = userRole;
|
|
}
|
|
|
|
public Timestamp getCreatedTime()
|
|
{
|
|
return createdTime;
|
|
}
|
|
|
|
public int getGodLevel()
|
|
{
|
|
return godLevel;
|
|
}
|
|
|
|
public void setGodLevel(int godLevel)
|
|
{
|
|
this.godLevel = godLevel;
|
|
}
|
|
|
|
public long getStationId()
|
|
{
|
|
return stationId;
|
|
}
|
|
|
|
public void setStationId(long stationId)
|
|
{
|
|
this.stationId = stationId;
|
|
}
|
|
|
|
}
|