package cn.axzo.msg.center.inside.notices.event;

import cn.axzo.msg.center.api.request.MsgBody4Guest;
import org.springframework.context.ApplicationEvent;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @ClassName SendMessgeEvent
 * @Description
 * @Author zhangran
 * @Date 2022/4/8 11:36
 **/
public class SendMessageEvent extends ApplicationEvent {

  /**
   * 消息实体
   */
  private MsgBody4Guest message;
  /**
   * 消息id
   */
  private Long msgId;

  private AtomicInteger retryCounting = new AtomicInteger(0);

  private AtomicBoolean isSend = new AtomicBoolean(true);
  private String errMsg;


  public SendMessageEvent(Long msgId, MsgBody4Guest message) {
    super(AgencyChangeEvent.OBJECT);
    this.message = message;
    this.msgId = msgId;
  }

  public AtomicInteger getRetryCounting() {
    return retryCounting;
  }

  public MsgBody4Guest getMessage() {
    return message;
  }

  public Long getMsgId() {
    return msgId;
  }

  public String getErrMsg() {
    return errMsg;
  }

  public void setErrMsg(String errMsg) {
    this.errMsg = errMsg;
  }

  public AtomicBoolean getIsSend() {
    return isSend;
  }
}
