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

io.github.wslxm.springbootplus2.starter.websocket.service.WebsocketService Maven / Gradle / Ivy

package io.github.wslxm.springbootplus2.starter.websocket.service;

import io.github.wslxm.springbootplus2.starter.websocket.model.dto.WebsocketMsgDTO;
import io.github.wslxm.springbootplus2.starter.websocket.model.vo.OnlineUserVO;

import java.util.List;
import java.util.Map;

/**
 * @author wangsong
 * websocket 监听类(连接,断点,消息发送等)
 * 

* /websocket/{userId}/{username} = /websocket/用户Id/用户名 来连接websocket,该参数会带到每一个监听方法中 *

*/ public interface WebsocketService { /** * 发送消息 * * @param dto * @version 1.0.0 */ void send(WebsocketMsgDTO dto); /** * 获取当前在线列表 * * @return 用户map列表, ket = 用户id * @version 1.0.0 */ Map getOnlineUsers(); /** * 获取在线人数 * * @return int * @version 1.0.0 */ Integer getOnlineCount(); /** * 在线 * 判断指定用户是否在线 * @return true 在线 / false 不在线 * @param userId 用户id */ boolean isOnline(String userId); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy