package com.qmth.themis.business.dto;

import com.qmth.themis.business.constant.SystemConstant;

import java.io.Serializable;

/**
 * @Description: websocket dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/7/28
 */
public class WebsocketDto implements Serializable {

    private String type; //类型
    private Long time; //时间戳
    private Object body; //内容

    public WebsocketDto() {

    }

    public WebsocketDto(String type, Object body) {
        this.type = type;
        this.time = System.currentTimeMillis();
        this.body = body;
    }

    public WebsocketDto(Object body) {
        this.type = SystemConstant.OK;
        this.time = System.currentTimeMillis();
        this.body = body;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }
}
