package com.ssj.bean.sys.message.domain;

import com.ssj.bean.common.framework.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Table(name="tb_message")
@Entity
public class Message extends BaseEntity implements Cloneable{

	private static final long serialVersionUID = 1L;

	private Date created;				/*创建时间*/
	private Date lastUpdated;			/*最后更新时间*/
	private String captions;           	/*标题*/
	private String coverUrl;			/*封面图片地址*/
	private String summary;				/*摘要*/
	private String contents;           	/*内容*/
	private String type;               	/*推送端 0：全部，1：学生端 2：家长端 3：老师端 4:校长端*/
	//private Date publishDate;        	/*发布时间*/

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@Column(updatable=false)
	public Date getCreated() {
		return created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getLastUpdated() {
		return lastUpdated;
	}
	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}

	public String getContents() {
		return contents;
	}
	public void setContents(String contents) {
		this.contents = contents;
	}

	public String getCaptions() {
		return captions;
	}
	public void setCaptions(String captions) {
		this.captions = captions;
	}

	public String getCoverUrl() {
		return coverUrl;
	}
	public void setCoverUrl(String coverUrl) {
		this.coverUrl = coverUrl;
	}

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}

	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
/*@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	public Date getPublishDate() {
		return publishDate;
	}
	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}*/

	@Override
	public Object clone() {
		Message message = null;
		try {
			message = (Message) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return message;
	}
}
