package com.jeesite.modules.consult.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 咨询帮助-从表Entity
 * @author wxm
 * @version 2022-06-07
 */
@Table(name="${_prefix}consult_help_slave", alias="a", label="咨询帮助-从表信息", columns={
		@Column(name="consult_id", attrName="consultId", label="咨询帮助关联id"),
		@Column(name="id", attrName="id", label="主键id  冗余字段", isPK=true),
		@Column(name="user_id", attrName="userId", label="回复人id"),
		@Column(name="user_name", attrName="userName", label="回复人姓名", queryType=QueryType.LIKE),
		@Column(name="create_time", attrName="createTime", label="回复时间", isUpdateForce=true),
		@Column(name="content", attrName="content", label="回复内容"),
		@Column(name="is_public", attrName="isPublic", label="回复是否公开 0 否 1是"),
	}, orderBy="a.id DESC"
)
public class ConsultHelpSlave extends DataEntity<ConsultHelpSlave> {
	
	private static final long serialVersionUID = 1L;
	private String consultId;		// 咨询帮助关联id
	private String userId;		// 回复人id
	private String userName;		// 回复人姓名
	private Date createTime;		// 回复时间
	private String content;		// 回复内容
	private String isPublic;		// 回复是否公开 0 否 1是

	
	public ConsultHelpSlave() {
		this(null);
	}
	
	public ConsultHelpSlave(String id){
		super(id);
	}
	
	@NotBlank(message="咨询帮助关联id不能为空")
	@Size(min=0, max=100, message="咨询帮助关联id长度不能超过 100 个字符")
	public String getConsultId() {
		return consultId;
	}

	public void setConsultId(String consultId) {
		this.consultId = consultId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@Size(min=0, max=255, message="回复人姓名长度不能超过 255 个字符")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@NotBlank(message="回复内容不能为空")
	@Size(min=0, max=300, message="回复内容长度不能超过 300 个字符")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Size(min=0, max=1, message="回复是否公开 0 否 1是长度不能超过 1 个字符")
	public String getIsPublic() {
		return isPublic;
	}

	public void setIsPublic(String isPublic) {
		this.isPublic = isPublic;
	}

}