Files
OpenIsle/src/main/java/com/openisle/model/User.java

47 lines
906 B
Java

package com.openisle.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import com.openisle.model.Role;
/**
* Simple user entity with basic fields and a role.
*/
@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, unique = true)
private String username;
@Column(nullable = false, unique = true)
private String email;
@Column(nullable = false)
private String password;
@Column(nullable = false)
private boolean verified = false;
private String verificationCode;
private String avatar;
@Column(length = 1000)
private String introduction;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private Role role = Role.USER;
}