package com.cpop.core.base.table;

import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.cpop.core.base.enums.UserType;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 系统用户
 *
 * @author DB.lost
 * @Date: 2023-05-05
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_sys_user", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class SysUser extends BaseEntity implements Serializable {

    /**
    * 主键
    */
    @Id
    private String id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 密码
     */
    private String password;

    /**
     * rsa加密后的密码
     */
    private String rsaPassword;

    /**
    * 昵称
    */
    private String nickName;

    /**
    * 邮箱
    */
    private String email;

    /**
    * 手机号
    */
    private String phoneNumber;

    /**
    * 性别(0:男;1:女)
    */
    private Boolean sex;

    /**
    * 头像
    */
    private String avatar;

    /**
    * 盐
    */
    private String salt;

    /**
    * 状态(0:停用;1:启用)
    */
    private Boolean status;

    /**
    * 登录地IP
    */
    private String loginIp;

    /**
     * 用户类型
     */
    private String userType;

    /**
    * 逻辑删除（0否1是）
    */
    @Column(isLogicDelete = true)
    private Boolean isDelete;
}
