package com.fjhx.event;

import com.alibaba.fastjson.JSONObject;
import com.fjhx.entity.MessageEntity;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

import java.util.Date;

/**
 * webStock推送的用户离线事件
 */
@Getter
public class WebSocketUserOfflineEvent extends ApplicationEvent {

    private final MessageEntity messageEntity = new MessageEntity();

    public WebSocketUserOfflineEvent(String userId, JSONObject message) {
        super(userId);
        this.messageEntity.setUserId(userId);
        this.messageEntity.setData(message);
        this.messageEntity.setCreateTime(new Date());
    }

}