package com.jeesite.modules.yinet.entity;

import javax.validation.constraints.Size;
import java.util.Date;
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;

/**
 * yinet_messageEntity
 * @author xqx
 * @version 2022-06-16
 */
@Table(name="yinet_message", alias="a", label="yinet_message信息", columns={
		@Column(name="message_id", attrName="messageId", label="id", isPK=true),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="内容"),
		@Column(name="message_type_id", attrName="messageTypeId", label="消息类型id", isUpdateForce=true),
		@Column(name="message_state", attrName="messageState", label="消息状态0", comment="消息状态0：草稿、1：已发"),
		@Column(name="message_rule_id", attrName="messageRuleId", label="消息规则id", isUpdateForce=true),
		@Column(name="message_ditch_id", attrName="messageDitchId", label="消息渠道id", isUpdateForce=true),
		@Column(name="create_by", attrName="createBy", label="创建人", isUpdate=false, isQuery=false),
		@Column(name="creaet_time", attrName="creaetTime", label="创建时间", isUpdateForce=true),
	}, orderBy="a.message_id DESC"
)
public class YinetMessage extends DataEntity<YinetMessage> {

	private static final long serialVersionUID = 1L;
	private Long messageId;		// id
	private String title;		// 标题
	private String content;		// 内容
	private Long messageTypeId;		// 消息类型id
	private String messageState;		// 消息状态0：草稿、1：已发
	private Long messageRuleId;		// 消息规则id
	private Long messageDitchId;		// 消息渠道id
	private Date creaetTime;		// 创建时间

	public YinetMessage() {
		this(null);
	}

	public YinetMessage(String id){
		super(id);
	}

	public Long getMessageId() {
		return messageId;
	}

	public void setMessageId(Long messageId) {
		this.messageId = messageId;
	}

	@Size(min=0, max=255, message="标题长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Size(min=0, max=500, message="内容长度不能超过 500 个字符")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Long getMessageTypeId() {
		return messageTypeId;
	}

	public void setMessageTypeId(Long messageTypeId) {
		this.messageTypeId = messageTypeId;
	}

	@Size(min=0, max=2, message="消息状态0长度不能超过 2 个字符")
	public String getMessageState() {
		return messageState;
	}

	public void setMessageState(String messageState) {
		this.messageState = messageState;
	}

	public Long getMessageRuleId() {
		return messageRuleId;
	}

	public void setMessageRuleId(Long messageRuleId) {
		this.messageRuleId = messageRuleId;
	}

	public Long getMessageDitchId() {
		return messageDitchId;
	}

	public void setMessageDitchId(Long messageDitchId) {
		this.messageDitchId = messageDitchId;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreaetTime() {
		return creaetTime;
	}

	public void setCreaetTime(Date creaetTime) {
		this.creaetTime = creaetTime;
	}

}
