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.
hotels/back/src/main/java/com/entity/UserEntity.java

101 lines
2.5 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.

// 声明该类所属的包为 com.entity一般用于存放与数据库实体相关的类
package com.entity;
// 导入 Serializable 接口,实现该接口的类的对象可进行序列化和反序列化操作
import java.io.Serializable;
// 导入 Date 类,用于处理日期和时间相关的数据
import java.util.Date;
// 导入 MyBatis-Plus 框架的 TableId 注解,用于标识数据库表的主键字段
import com.baomidou.mybatisplus.annotations.TableId;
// 导入 MyBatis-Plus 框架的 TableName 注解,用于指定该实体类对应的数据库表名
import com.baomidou.mybatisplus.annotations.TableName;
// 导入 MyBatis-Plus 框架的 IdType 枚举,用于指定主键的生成策略
import com.baomidou.mybatisplus.enums.IdType;
/**
* 用户
*/
// 使用 TableName 注解指定该实体类对应的数据库表名为 "users"
@TableName("users")
// 定义 UserEntity 类,实现 Serializable 接口
public class UserEntity implements Serializable {
// 定义序列化版本号,用于在序列化和反序列化过程中保持类的版本一致性
private static final long serialVersionUID = 1L;
// 使用 TableId 注解标识该字段为主键,并指定主键生成策略为自动增长
@TableId(type = IdType.AUTO)
// 主键 id用于唯一标识数据库表中的每条记录
private Long id;
/**
* 用户账号
*/
// 存储用户的账号信息
private String username;
/**
* 密码
*/
// 存储用户的密码信息
private String password;
/**
* 用户类型
*/
// 存储用户的类型,如普通用户、管理员等
private String role;
// 记录用户的添加时间
private Date addtime;
// 获取用户账号的方法
public String getUsername() {
return username;
}
// 设置用户账号的方法
public void setUsername(String username) {
this.username = username;
}
// 获取用户密码的方法
public String getPassword() {
return password;
}
// 设置用户密码的方法
public void setPassword(String password) {
this.password = password;
}
// 获取用户类型的方法
public String getRole() {
return role;
}
// 设置用户类型的方法
public void setRole(String role) {
this.role = role;
}
// 获取用户添加时间的方法
public Date getAddtime() {
return addtime;
}
// 设置用户添加时间的方法
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键 id 的方法
public Long getId() {
return id;
}
// 设置主键 id 的方法
public void setId(Long id) {
this.id = id;
}
}