Update YonghuVO.java

王刚注释
pz2femycj 4 months ago
parent 8e044330aa
commit af8eb02ecf

@ -1,326 +1,273 @@
package com.entity.vo; // 包声明
package com.entity;
import com.entity.YonghuEntity; // 导入Java核心库
import com.baomidou.mybatisplus.annotations.TableField; import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableName; import java.lang.reflect.InvocationTargetException;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date; import java.util.Date;
// 导入校验相关注解
import javax.validation.constraints.*;
// 导入Jackson注解
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入Apache工具类
import org.apache.tools.ant.util.DateUtils;
import org.apache.commons.beanutils.BeanUtils;
// 导入Spring框架注解
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; // 导入MyBatis Plus注解
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 导入自定义注解和工具类
import com.annotation.ColumnInfo;
import com.utils.DateUtil;
/** // 用户实体类对应数据库表yonghu
*
*
*
*/
@TableName("yonghu") @TableName("yonghu")
public class YonghuVO implements Serializable { public class YonghuEntity<T> implements Serializable {
// 序列化版本UID
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
// 无参构造方法
public YonghuEntity() {
}
/** // 带泛型参数的构造方法通过BeanUtils进行属性拷贝
* public YonghuEntity(T t) {
*/ try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// 异常处理(打印堆栈跟踪)
e.printStackTrace();
}
}
// 主键(自增)
@TableId(type = IdType.AUTO)
@ColumnInfo(comment = "主键", type = "int(11)")
@TableField(value = "id") @TableField(value = "id")
private Integer id; private Integer id;
// 用户账户
/** @ColumnInfo(comment = "账户", type = "varchar(200)")
*
*/
@TableField(value = "username") @TableField(value = "username")
private String username; private String username;
// 登录密码
/** @ColumnInfo(comment = "密码", type = "varchar(200)")
*
*/
@TableField(value = "password") @TableField(value = "password")
private String password; private String password;
// 用户真实姓名
/** @ColumnInfo(comment = "用户名称", type = "varchar(200)")
*
*/
@TableField(value = "yonghu_name") @TableField(value = "yonghu_name")
private String yonghuName; private String yonghuName;
// 用户手机号码
/** @ColumnInfo(comment = "用户手机号", type = "varchar(200)")
*
*/
@TableField(value = "yonghu_phone") @TableField(value = "yonghu_phone")
private String yonghuPhone; private String yonghuPhone;
// 用户身份证号码
/** @ColumnInfo(comment = "用户身份证号", type = "varchar(200)")
*
*/
@TableField(value = "yonghu_id_number") @TableField(value = "yonghu_id_number")
private String yonghuIdNumber; private String yonghuIdNumber;
// 用户头像存储路径
/** @ColumnInfo(comment = "用户头像", type = "varchar(200)")
*
*/
@TableField(value = "yonghu_photo") @TableField(value = "yonghu_photo")
private String yonghuPhoto; private String yonghuPhoto;
// 性别0=未知,1=男,2=女)
/** @ColumnInfo(comment = "性别", type = "int(11)")
*
*/
@TableField(value = "sex_types") @TableField(value = "sex_types")
private Integer sexTypes; private Integer sexTypes;
// 用户电子邮箱
/** @ColumnInfo(comment = "用户邮箱", type = "varchar(200)")
*
*/
@TableField(value = "yonghu_email") @TableField(value = "yonghu_email")
private String yonghuEmail; private String yonghuEmail;
// 账户余额(十进制类型)
/** @ColumnInfo(comment = "现有余额", type = "decimal(10,2)")
*
*/
@TableField(value = "new_money") @TableField(value = "new_money")
private Double newMoney; private Double newMoney;
// 逻辑删除标记0=正常,1=删除)
/** @ColumnInfo(comment = "逻辑删除", type = "int(11)")
*
*/
@TableField(value = "data_delete") @TableField(value = "data_delete")
private Integer dataDelete; private Integer dataDelete;
// 数据插入时间(自动填充)
/** @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat @DateTimeFormat
@ColumnInfo(comment = "添加时间", type = "timestamp")
@TableField(value = "insert_time") @TableField(value = "insert_time", fill = FieldFill.INSERT)
private Date insertTime; private Date insertTime;
// 记录创建时间(自动填充)
/** @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat @DateTimeFormat
@ColumnInfo(comment = "创建时间", type = "timestamp")
@TableField(value = "create_time") @TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime; private Date createTime;
// 获取主键ID
/**
*
*/
public Integer getId() { public Integer getId() {
return id; return id;
} }
// 设置主键ID
/**
*
*/
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
/**
* // 获取用户账户
*/
public String getUsername() { public String getUsername() {
return username; return username;
} }
// 设置用户账户
/**
*
*/
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
/**
* // 获取登录密码
*/
public String getPassword() { public String getPassword() {
return password; return password;
} }
// 设置登录密码
/**
*
*/
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
/**
* // 获取用户真实姓名
*/
public String getYonghuName() { public String getYonghuName() {
return yonghuName; return yonghuName;
} }
// 设置用户真实姓名
/**
*
*/
public void setYonghuName(String yonghuName) { public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName; this.yonghuName = yonghuName;
} }
/**
* // 获取用户手机号
*/
public String getYonghuPhone() { public String getYonghuPhone() {
return yonghuPhone; return yonghuPhone;
} }
// 设置用户手机号
/**
*
*/
public void setYonghuPhone(String yonghuPhone) { public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone; this.yonghuPhone = yonghuPhone;
} }
/**
* // 获取身份证号码
*/
public String getYonghuIdNumber() { public String getYonghuIdNumber() {
return yonghuIdNumber; return yonghuIdNumber;
} }
// 设置身份证号码
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) { public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber; this.yonghuIdNumber = yonghuIdNumber;
} }
/**
* // 获取头像路径
*/
public String getYonghuPhoto() { public String getYonghuPhoto() {
return yonghuPhoto; return yonghuPhoto;
} }
// 设置头像路径
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) { public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto; this.yonghuPhoto = yonghuPhoto;
} }
/**
* // 获取性别类型
*/
public Integer getSexTypes() { public Integer getSexTypes() {
return sexTypes; return sexTypes;
} }
// 设置性别类型
/**
*
*/
public void setSexTypes(Integer sexTypes) { public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes; this.sexTypes = sexTypes;
} }
/**
* // 获取用户邮箱
*/
public String getYonghuEmail() { public String getYonghuEmail() {
return yonghuEmail; return yonghuEmail;
} }
// 设置用户邮箱
/**
*
*/
public void setYonghuEmail(String yonghuEmail) { public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail; this.yonghuEmail = yonghuEmail;
} }
/**
* // 获取账户余额
*/
public Double getNewMoney() { public Double getNewMoney() {
return newMoney; return newMoney;
} }
// 设置账户余额
/**
*
*/
public void setNewMoney(Double newMoney) { public void setNewMoney(Double newMoney) {
this.newMoney = newMoney; this.newMoney = newMoney;
} }
/**
* // 获取逻辑删除状态
*/
public Integer getDataDelete() { public Integer getDataDelete() {
return dataDelete; return dataDelete;
} }
// 设置逻辑删除状态
/**
*
*/
public void setDataDelete(Integer dataDelete) { public void setDataDelete(Integer dataDelete) {
this.dataDelete = dataDelete; this.dataDelete = dataDelete;
} }
/**
* // 获取数据插入时间
*/
public Date getInsertTime() { public Date getInsertTime() {
return insertTime; return insertTime;
} }
// 设置数据插入时间
/**
*
*/
public void setInsertTime(Date insertTime) { public void setInsertTime(Date insertTime) {
this.insertTime = insertTime; this.insertTime = insertTime;
} }
/**
* // 获取记录创建时间
*/
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
// 设置记录创建时间
/**
*
*/
public void setCreateTime(Date createTime) { public void setCreateTime(Date createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
// 重写toString方法返回对象字符串表示
@Override
public String toString() {
return "Yonghu{" +
", id=" + id +
", username=" + username +
", password=" + password +
", yonghuName=" + yonghuName +
", yonghuPhone=" + yonghuPhone +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhoto=" + yonghuPhoto +
", sexTypes=" + sexTypes +
", yonghuEmail=" + yonghuEmail +
", newMoney=" + newMoney +
", dataDelete=" + dataDelete +
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
"}";
}
} }
Loading…
Cancel
Save