All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.wslxm.springbootplus2.starter.websocket.model.vo.SendMsgVO Maven / Gradle / Ivy

package io.github.wslxm.springbootplus2.starter.websocket.model.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;


/**
 *  websocket客户端-接收端-返回参数
 *
 * @author 王松
 * @mail [email protected]
 * @date 2020/6/30 0030 18:24
 */
@Data
public class SendMsgVO implements Serializable {
    private static final long serialVersionUID = -9051438901021877148L;

    /**
     * 发送人用户Id (来源Id,上线为上线线人的用户Id)
     */
    private String from;
    /**
     * 发送人用户名 (上下线为上线线人的用户名)
     */
    private String username;

    /**
     * 接收人用户Id (目标ID,逗号分隔) (所有人使用-ALL,包括自己在内也能接收)
     */
    private String to;
    /**
     * 发送内容(text/json)
     */
    private String content;
    /**
     * 扩展消息字段(text/json)
     */
    private String extras;
    /**
     * 当前在线人数
     */
    private Integer onlineNum;
    /**
     * 消息创建时间(YYYY-MM-DD )
     */
    private String createTime;


    public SendMsgVO() {
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        this.createTime = df.format(LocalDateTime.now());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy