diff --git a/JianshenkechengLiuyanEntity.java b/JianshenkechengLiuyanEntity.java index 1430700..ce6a62c 100644 --- a/JianshenkechengLiuyanEntity.java +++ b/JianshenkechengLiuyanEntity.java @@ -1,243 +1,134 @@ -package com.entity; - -import com.annotation.ColumnInfo; -import javax.validation.constraints.*; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import java.lang.reflect.InvocationTargetException; -import java.io.Serializable; -import java.util.*; -import org.apache.tools.ant.util.DateUtils; -import org.springframework.format.annotation.DateTimeFormat; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.apache.commons.beanutils.BeanUtils; -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.utils.DateUtil; - - -/** - * 课程留言 - * - * @author - * @email - */ -@TableName("jianshenkecheng_liuyan") -public class JianshenkechengLiuyanEntity implements Serializable { - private static final long serialVersionUID = 1L; - - - public JianshenkechengLiuyanEntity() { - - } - - public JianshenkechengLiuyanEntity(T t) { - try { - BeanUtils.copyProperties(this, t); - } catch (IllegalAccessException | InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - /** - * 主键 - */ - @TableId(type = IdType.AUTO) - @ColumnInfo(comment="主键",type="int(11)") - @TableField(value = "id") - - private Integer id; - - - /** - * 健身课程 - */ - @ColumnInfo(comment="健身课程",type="int(11)") - @TableField(value = "jianshenkecheng_id") - - private Integer jianshenkechengId; - - - /** - * 用户 - */ - @ColumnInfo(comment="用户",type="int(11)") - @TableField(value = "yonghu_id") - - private Integer yonghuId; - - - /** - * 留言内容 - */ - @ColumnInfo(comment="留言内容",type="longtext") - @TableField(value = "jianshenkecheng_liuyan_text") - - private String jianshenkechengLiuyanText; - - - /** - * 留言时间 - */ - @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") - @DateTimeFormat - @ColumnInfo(comment="留言时间",type="timestamp") - @TableField(value = "insert_time",fill = FieldFill.INSERT) - - private Date insertTime; - - - /** - * 回复内容 - */ - @ColumnInfo(comment="回复内容",type="longtext") - @TableField(value = "reply_text") - - private String replyText; - - - /** - * 回复时间 - */ - @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") - @DateTimeFormat - @ColumnInfo(comment="回复时间",type="timestamp") - @TableField(value = "update_time",fill = FieldFill.UPDATE) - - private Date updateTime; - - - /** - * 创建时间 listShow - */ - @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") - @DateTimeFormat - @ColumnInfo(comment="创建时间",type="timestamp") - @TableField(value = "create_time",fill = FieldFill.INSERT) - - private Date createTime; - - - /** - * 获取:主键 - */ - public Integer getId() { - return id; - } - /** - * 设置:主键 - */ - - public void setId(Integer id) { - this.id = id; - } - /** - * 获取:健身课程 - */ - public Integer getJianshenkechengId() { - return jianshenkechengId; - } - /** - * 设置:健身课程 - */ - - public void setJianshenkechengId(Integer jianshenkechengId) { - this.jianshenkechengId = jianshenkechengId; - } - /** - * 获取:用户 - */ - public Integer getYonghuId() { - return yonghuId; - } - /** - * 设置:用户 - */ - - public void setYonghuId(Integer yonghuId) { - this.yonghuId = yonghuId; - } - /** - * 获取:留言内容 - */ - public String getJianshenkechengLiuyanText() { - return jianshenkechengLiuyanText; - } - /** - * 设置:留言内容 - */ - - public void setJianshenkechengLiuyanText(String jianshenkechengLiuyanText) { - this.jianshenkechengLiuyanText = jianshenkechengLiuyanText; - } - /** - * 获取:留言时间 - */ - public Date getInsertTime() { - return insertTime; - } - /** - * 设置:留言时间 - */ - - public void setInsertTime(Date insertTime) { - this.insertTime = insertTime; - } - /** - * 获取:回复内容 - */ - public String getReplyText() { - return replyText; - } - /** - * 设置:回复内容 - */ - - public void setReplyText(String replyText) { - this.replyText = replyText; - } - /** - * 获取:回复时间 - */ - public Date getUpdateTime() { - return updateTime; - } - /** - * 设置:回复时间 - */ - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - /** - * 获取:创建时间 listShow - */ - public Date getCreateTime() { - return createTime; - } - /** - * 设置:创建时间 listShow - */ - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - @Override - public String toString() { - return "JianshenkechengLiuyan{" + - ", id=" + id + - ", jianshenkechengId=" + jianshenkechengId + - ", yonghuId=" + yonghuId + - ", jianshenkechengLiuyanText=" + jianshenkechengLiuyanText + - ", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") + - ", replyText=" + replyText + - ", updateTime=" + DateUtil.convertString(updateTime,"yyyy-MM-dd") + - ", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") + - "}"; - } -} +package com.entity.vo; + +import com.entity.JianshenkechengLiuyanEntity; +import com.baomidou.mybatisplus.annotations.TableField; +import com.baomidou.mybatisplus.annotations.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +// 健身课程留言手机端接口返回VO,去除不必要字段 +@TableName("jianshenkecheng_liuyan") +public class JianshenkechengLiuyanVO implements Serializable { + private static final long serialVersionUID = 1L; + + // 主键ID + @TableField(value = "id") + private Integer id; + + // 关联的健身课程ID + @TableField(value = "jianshenkecheng_id") + private Integer jianshenkechengId; + + // 留言用户ID + @TableField(value = "yonghu_id") + private Integer yonghuId; + + // 留言内容文本 + @TableField(value = "jianshenkecheng_liuyan_text") + private String jianshenkechengLiuyanText; + + // 留言时间(带时区格式化) + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + @DateTimeFormat + @TableField(value = "insert_time") + private Date insertTime; + + // 管理员回复内容 + @TableField(value = "reply_text") + private String replyText; + + // 回复时间(带时区格式化) + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + @DateTimeFormat + @TableField(value = "update_time") + private Date updateTime; + + // 记录创建时间(用于特定展示场景) + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + @DateTimeFormat + @TableField(value = "create_time") + private Date createTime; + + // 获取:主键ID + public Integer getId() { + return id; + } + + // 设置:主键ID + public void setId(Integer id) { + this.id = id; + } + + // 获取:关联课程ID + public Integer getJianshenkechengId() { + return jianshenkechengId; + } + + // 设置:关联课程ID + public void setJianshenkechengId(Integer jianshenkechengId) { + this.jianshenkechengId = jianshenkechengId; + } + + // 获取:留言用户ID + public Integer getYonghuId() { + return yonghuId; + } + + // 设置:留言用户ID + public void setYonghuId(Integer yonghuId) { + this.yonghuId = yonghuId; + } + + // 获取:留言内容 + public String getJianshenkechengLiuyanText() { + return jianshenkechengLiuyanText; + } + + // 设置:留言内容 + public void setJianshenkechengLiuyanText(String jianshenkechengLiuyanText) { + this.jianshenkechengLiuyanText = jianshenkechengLiuyanText; + } + + // 获取:留言时间 + public Date getInsertTime() { + return insertTime; + } + + // 设置:留言时间 + public void setInsertTime(Date insertTime) { + this.insertTime = insertTime; + } + + // 获取:回复内容 + public String getReplyText() { + return replyText; + } + + // 设置:回复内容 + public void setReplyText(String replyText) { + this.replyText = replyText; + } + + // 获取:回复时间 + public Date getUpdateTime() { + return updateTime; + } + + // 设置:回复时间 + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + // 获取:创建时间(展示用) + public Date getCreateTime() { + return createTime; + } + + // 设置:创建时间(展示用) + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} \ No newline at end of file