You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
exam/sys/user/entity/SysUser.java

104 lines
3.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 声明当前类所在的包,明确该类属于系统用户实体类所在的包
package com.yf.exam.modules.sys.user.entity;
// 导入 MyBatis-Plus 注解,用于指定主键生成策略
import com.baomidou.mybatisplus.annotation.IdType;
// 导入 MyBatis-Plus 注解,用于指定数据库表字段名
import com.baomidou.mybatisplus.annotation.TableField;
// 导入 MyBatis-Plus 注解,用于指定数据库表的主键
import com.baomidou.mybatisplus.annotation.TableId;
// 导入 MyBatis-Plus 注解,用于指定实体类对应的数据库表名
import com.baomidou.mybatisplus.annotation.TableName;
// 导入 MyBatis-Plus 扩展的 ActiveRecord 模式基类
import com.baomidou.mybatisplus.extension.activerecord.Model;
// 导入 Lombok 注解,自动生成 getter、setter、equals、hashCode 和 toString 方法
import lombok.Data;
// 导入 Date 类,用于表示日期和时间
import java.util.Date;
/**
* <p>
* 管理用户实体类,用于映射数据库中的 sys_user 表,封装管理用户的相关属性。
* 该类继承自 MyBatis-Plus 的 Model 类,可使用 ActiveRecord 模式进行数据库操作。
* </p>
*
* @author 聪明笨狗
* @since 2020-04-13 16:57
*/
// 使用 Lombok 的 @Data 注解,自动生成 getter、setter、equals、hashCode 和 toString 方法
@Data
// 指定该实体类对应的数据库表名为 sys_user
@TableName("sys_user")
public class SysUser extends Model<SysUser> {
// 序列化版本号,用于在反序列化时验证版本一致性
private static final long serialVersionUID = 1L;
/**
* 用户的唯一标识 ID
* 使用 MyBatis-Plus 的 @TableId 注解指定该字段为主键,
* value 属性指定数据库表中的字段名type 属性指定主键生成策略为 ASSIGN_ID
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
* 用户名,对应数据库表中的 user_name 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("user_name")
private String userName;
/**
* 真实姓名,对应数据库表中的 real_name 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("real_name")
private String realName;
/**
* 用户密码,未指定 @TableField 时,默认字段名与属性名相同
*/
private String password;
/**
* 密码盐,用于增强密码的安全性,未指定 @TableField 时,默认字段名与属性名相同
*/
private String salt;
/**
* 角色列表,以字符串形式存储角色 ID对应数据库表中的 role_ids 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("role_ids")
private String roleIds;
/**
* 部门 ID对应数据库表中的 depart_id 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("depart_id")
private String departId;
/**
* 用户记录的创建时间,对应数据库表中的 create_time 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("create_time")
private Date createTime;
/**
* 用户记录的更新时间,对应数据库表中的 update_time 字段
* 使用 MyBatis-Plus 的 @TableField 注解指定数据库表中的字段名
*/
@TableField("update_time")
private Date updateTime;
/**
* 用户状态,未指定 @TableField 时,默认字段名与属性名相同
*/
private Integer state;
}