package com.ningdatech.pmapi.sys.model.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * <p>
 * 通知
 * </p>
 *
 * @author zpf
 * @since 2023-03-21
 */
@Data
@ApiModel(value = "消息通知VO", description = "消息通知")
public class NotifyVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("消息类型")
    private String type;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("实例id")
    private String instanceId;

    @ApiModelProperty("是否已读")
    private Boolean readed;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("link")
    private String link;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("项目ID")
    private Long projectId;

    @ApiModelProperty("会议ID")
    private Long meetingId;

    public String getTypeName(){
        if(Objects.nonNull(this.type)){
            return MsgTypeEnum.getDescByName(this.type);
        }
        return StringUtils.EMPTY;
    }
}
