package com.mortals.xhx.module.notice.model;

import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.notice.model.vo.NoticeVo;
/**
 * 用户消息实体对象
 *
 * @author zxfei
 * @date 2023-04-16
 */

public class NoticeEntity extends NoticeVo {
    private static final long serialVersionUID = 1L;

    /**
     * 接收消息的用户的唯一标识符
     */
    private Long userId;
    /**
     * 消息的标题
     */
    @Excel(name = "消息的标题")
    private String title;
    /**
     * 消息的内容
     */
    @Excel(name = "消息的内容")
    private String content;
    /**
     * 是否已读 (0.否,1.是)
     */
    @Excel(name = "是否已读 ", readConverterExp = "0=否,1.是")
    private Integer read;
    /**
     * 消息的优先级，越高表示越紧急，不为空
     */
    @Excel(name = "消息的优先级，越高表示越紧急，不为空")
    private Integer priority;
    /**
     * 消息的过期时间，超过此时间则自动标记为已读
     */
    private Date expireTime;
    /**
     * 消息的来源类型，例如“系统”、“好友”等，可以为空
     */
    @Excel(name = "消息的来源类型，例如“系统”、“好友”等，可以为空")
    private String sourceType;



    public NoticeEntity(){}
    /**
     * 获取 接收消息的用户的唯一标识符
     * @return Long
     */
    public Long getUserId(){
        return userId;
    }
    /**
     * 设置 接收消息的用户的唯一标识符
     * @param userId
     */
    public void setUserId(Long userId){
        this.userId = userId;
    }
    /**
     * 获取 消息的标题
     * @return String
     */
    public String getTitle(){
        return title;
    }
    /**
     * 设置 消息的标题
     * @param title
     */
    public void setTitle(String title){
        this.title = title;
    }
    /**
     * 获取 消息的内容
     * @return String
     */
    public String getContent(){
        return content;
    }
    /**
     * 设置 消息的内容
     * @param content
     */
    public void setContent(String content){
        this.content = content;
    }
    /**
     * 获取 是否已读 (0.否,1.是)
     * @return Integer
     */
    public Integer getRead(){
        return read;
    }
    /**
     * 设置 是否已读 (0.否,1.是)
     * @param read
     */
    public void setRead(Integer read){
        this.read = read;
    }
    /**
     * 获取 消息的优先级，越高表示越紧急，不为空
     * @return Integer
     */
    public Integer getPriority(){
        return priority;
    }
    /**
     * 设置 消息的优先级，越高表示越紧急，不为空
     * @param priority
     */
    public void setPriority(Integer priority){
        this.priority = priority;
    }
    /**
     * 获取 消息的过期时间，超过此时间则自动标记为已读
     * @return Date
     */
    public Date getExpireTime(){
        return expireTime;
    }
    /**
     * 设置 消息的过期时间，超过此时间则自动标记为已读
     * @param expireTime
     */
    public void setExpireTime(Date expireTime){
        this.expireTime = expireTime;
    }
    /**
     * 获取 消息的来源类型，例如“系统”、“好友”等，可以为空
     * @return String
     */
    public String getSourceType(){
        return sourceType;
    }
    /**
     * 设置 消息的来源类型，例如“系统”、“好友”等，可以为空
     * @param sourceType
     */
    public void setSourceType(String sourceType){
        this.sourceType = sourceType;
    }




    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof NoticeEntity) {
            NoticeEntity tmp = (NoticeEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public String toString(){
        StringBuilder sb = new StringBuilder("");
        sb.append(",userId:").append(getUserId());
        sb.append(",title:").append(getTitle());
        sb.append(",content:").append(getContent());
        sb.append(",read:").append(getRead());
        sb.append(",priority:").append(getPriority());
        sb.append(",expireTime:").append(getExpireTime());
        sb.append(",sourceType:").append(getSourceType());
        return sb.toString();
    }

    public void initAttrValue(){

        this.userId = null;

        this.title = "";

        this.content = "";

        this.read = 0;

        this.priority = 0;

        this.expireTime = null;

        this.sourceType = "";
    }
}