package top.sunriseydy.syhthems.db.model;

import lombok.Data;
import org.hibernate.validator.constraints.URL;
import top.sunriseydy.syhthems.db.enums.UserStatusEnum;

import javax.persistence.*;
import javax.validation.constraints.Email;
import java.util.Date;

/**
 * @author SunriseYDY
 * Generated by MBG
 */
@Data
@Table(name = "`sys_user`")
public class User extends BaseModel {
    @Id
    @Column(name = "`user_id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long userId;

    /**
     * 用户名
     */
    @Column(name = "`username`")
    private String username;

    /**
     * 加密过的密码
     */
    @Column(name = "`user_password`")
    private String password;

    /**
     * 邮箱地址
     */
    @Column(name = "`email`")
    @Email
    private String email;

    /**
     * 电话号码
     */
    @Column(name = "`phone`")
    private String phone;

    /**
     * 用户头像
     */
    @Column(name = "`header`")
    @URL
    private String header;

    /**
     * 状态
     */
    @Column(name = "`user_status`")
    private UserStatusEnum userStatus;

    /**
     * 最后一次登录时间
     */
    @Column(name = "`last_login_time`")
    private Date lastLoginTime;

    /**
     * 是否第一次登录
     */
    @Column(name = "`first_login`")
    private String firstLogin;

    /**
     * 用户简介
     */
    @Column(name = "`user_description`")
    private String userDescription;

    public static final String USER_ID = "userId";

    public static final String DB_USER_ID = "user_id";

    public static final String USERNAME = "username";

    public static final String DB_USERNAME = "username";

    public static final String USER_PASSWORD = "password";

    public static final String DB_USER_PASSWORD = "user_password";

    public static final String EMAIL = "email";

    public static final String DB_EMAIL = "email";

    public static final String PHONE = "phone";

    public static final String DB_PHONE = "phone";

    public static final String HEADER = "header";

    public static final String DB_HEADER = "header";

    public static final String USER_STATUS = "userStatus";

    public static final String DB_USER_STATUS = "user_status";

    public static final String LAST_LOGIN_TIME = "lastLoginTime";

    public static final String DB_LAST_LOGIN_TIME = "last_login_time";

    public static final String FIRST_LOGIN = "firstLogin";

    public static final String DB_FIRST_LOGIN = "first_login";

    public static final String USER_DESCRIPTION = "userDescription";

    public static final String DB_USER_DESCRIPTION = "user_description";

    public static final String CREATE_TIME = "createTime";

    public static final String DB_CREATE_TIME = "create_time";

    public static final String LAST_UPDATE_TIME = "lastUpdateTime";

    public static final String DB_LAST_UPDATE_TIME = "last_update_time";

    public static final String LAST_UPDATE_BY = "lastUpdateBy";

    public static final String DB_LAST_UPDATE_BY = "last_update_by";
}