SysUser.java 1.75 KB
package com.youjia.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.youjia.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 用户表(sys_user)。
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
@Schema(description = "账号")
public class SysUser extends BaseEntity {

    @TableId(value = "user_id", type = IdType.AUTO)
    @Schema(description = "用户 ID")
    private Long userId;

    @Schema(description = "登录账号,唯一,创建后不可修改")
    private String account;

    @JsonIgnore
    @Schema(description = "密码(BCrypt 密文)", hidden = true)
    private String password;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "手机号,用于企微通知")
    private String mobile;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "主属组织 ID")
    private Long orgId;

    @Schema(description = "数据域:1-全部数据 2-本部门及下级 3-本部门 4-仅本人")
    private Integer dataScope;

    @Schema(description = "状态:1-启用 0-停用")
    private Integer status;

    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginAt;

    @Schema(description = "是否需强制改密:1-是 0-否(初始/重置密码后为 1,自助改密后为 0)")
    private Integer needChangePwd;

    @Schema(description = "备注")
    private String remark;
}