package cn.axzo.msg.center.im.domain.param;

import cn.axzo.msg.center.im.domain.dto.IMSendMessageDTO;
import cn.axzo.msg.center.im.domain.enums.AppClientTypeEnum;
import cn.axzo.msg.center.im.domain.enums.IMChannelEnum;
import cn.axzo.msg.center.im.domain.event.IMSendSingleMessageEvent;
import cn.axzo.msg.center.service.dto.PersonDTO;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.function.Consumer;

/**
 * @description
 *
 * @author cold_blade
 * @date 2023/9/27
 * @version 1.0
 */
@Setter
@Getter
public class IMSendSingleMessageParam implements Serializable {

    private static final long serialVersionUID = 235976408457947264L;

    /**
     * 消息
     */
    private IMSendMessageDTO message;
    /**
     * 消息发送者信息
     */
    private PersonDTO sender;
    /**
     * 消息接收者信息
     */
    private PersonDTO receiver;
    /**
     * 应用客户端类型
     */
    private AppClientTypeEnum appClientType;
    /**
     * 底层渠道发送消息后的回调
     */
    private Consumer<IMSendSingleMessageEvent> callback;
    /**
     * 指定推送渠道
     */
    private IMChannelEnum channel;
    /**
     * APP的版本号
     */
    private Integer appVersionCode;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
