增加项目README.md
This commit is contained in:
@ -1,10 +1,5 @@
|
||||
package com.heibaiying.constant;
|
||||
|
||||
/**
|
||||
* @author : 罗祥
|
||||
* @description :
|
||||
* @date :create in 2018/12/27
|
||||
*/
|
||||
public interface Constant {
|
||||
|
||||
String USER_NAME="username";
|
||||
|
@ -3,12 +3,10 @@ package com.heibaiying.controller;
|
||||
import com.heibaiying.constant.Constant;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* @author : 罗祥
|
||||
* @description : 简单登录
|
||||
* @date :create in 2018/12/27
|
||||
*/
|
||||
|
@ -3,7 +3,6 @@ package com.heibaiying.websocket;
|
||||
import com.heibaiying.constant.Constant;
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
import org.springframework.web.socket.WebSocketMessage;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
import org.springframework.web.socket.handler.TextWebSocketHandler;
|
||||
|
||||
@ -16,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* @author : heibaiying
|
||||
* @description : 自定义消息处理类
|
||||
*/
|
||||
public class CustomerHandler extends TextWebSocketHandler {
|
||||
public class CustomHandler extends TextWebSocketHandler {
|
||||
|
||||
private Map<String, WebSocketSession> nameAndSession = new ConcurrentHashMap<>();
|
||||
|
@ -32,10 +32,10 @@
|
||||
</bean>
|
||||
|
||||
<!--配置webSocket-->
|
||||
<bean id="customerHandler" class="com.heibaiying.websocket.CustomerHandler"/>
|
||||
<bean id="customHandler" class="com.heibaiying.websocket.CustomHandler"/>
|
||||
<websocket:handlers>
|
||||
<!--指定webSocket 地址-->
|
||||
<websocket:mapping path="/socket" handler="customerHandler"/>
|
||||
<websocket:mapping path="/socket" handler="customHandler"/>
|
||||
<!--webSocket握手-->
|
||||
<websocket:handshake-interceptors>
|
||||
<bean class="com.heibaiying.websocket.CustomHandshakeInterceptor"/>
|
||||
|
Reference in New Issue
Block a user