package com.zhongshu.card.client.model.tip;

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.UserCountSimpleModel;
import com.zhongshu.card.client.type.tip.BusFunctionType;
import com.zhongshu.card.client.type.tip.TipType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

/**
 * @author TRX
 * @date 2025/2/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TipInfoModel extends SuperModel {

    @Schema(description = "消息标题")
    private String title;

    @Schema(description = "消息内容")
    private String content;

    @Schema(description = "消息类型，如：系统信息、用户信息")
    private TipType tipType;

    private String tipTypeStr;

    public String getTipTypeStr() {
        if (tipType != null) {
            return tipType.getRemark();
        }
        return "";
    }

    @Schema(description = "扩展信息")
    private Map<String, Object> metaInfo = new HashMap<String, Object>();

    //--------------------------那个用户发送的 start ----------------

    @Schema(description = "发送用户的userId")
    private String fromUserId;

    private String fromUserName;

    @Schema(description = "发送用户信息")
    private UserCountSimpleModel fromUserAccount;

    //--------------------------关于那个用户的信息 start--------------
    private String toUserId;

    private String toUserName;

    @Schema(description = "接收用户信息")
    private UserCountSimpleModel toUserAccount;

    //---------------------是否阅读 start -------------

    @Schema(description = "是否阅读")
    private Boolean isRead;

    @Schema(description = "阅读时间")
    private Long readTime;

    //----------------------业务参数 start -------------

    @Schema(description = "关联业务数据id")
    private String busDataId;

    @Schema(description = "业务功能类型")
    private BusFunctionType busFunctionType;

    private String busFunctionTypeStr;

    public String getBusFunctionTypeStr() {
        if (busFunctionType != null) {
            return busFunctionType.getRemark();
        }
        return "";
    }

    @Schema(description = "业务数据状态")
    private String busStateStr;
}
