增加项目README.md
This commit is contained in:
		@@ -1,9 +1,7 @@
 | 
			
		||||
package com.heibaiying.constant;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @description :
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 */
 | 
			
		||||
public interface Constant {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import javax.servlet.http.HttpSession;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 * @description : 简单登录
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 */
 | 
			
		||||
@Controller
 | 
			
		||||
public class LoginController {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,9 +3,8 @@ package com.heibaiying.webconfig;
 | 
			
		||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 * @description : 等价于 web.xml 中配置前端控制器
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 */
 | 
			
		||||
public class DispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,9 +10,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 | 
			
		||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 * @description : 主配置类
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
@EnableWebMvc
 | 
			
		||||
 
 | 
			
		||||
@@ -6,9 +6,8 @@ import javax.servlet.annotation.WebFilter;
 | 
			
		||||
import javax.servlet.annotation.WebInitParam;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 * @description : 编码过滤器 防止乱码
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 */
 | 
			
		||||
@WebFilter(filterName = "characterEncodingFilter", urlPatterns = "/*",
 | 
			
		||||
        initParams = {
 | 
			
		||||
 
 | 
			
		||||
@@ -15,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<>();
 | 
			
		||||
 | 
			
		||||
@@ -6,9 +6,8 @@ import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
 | 
			
		||||
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author : 罗祥
 | 
			
		||||
 * @author : heibaiying
 | 
			
		||||
 * @description :websocket 配置
 | 
			
		||||
 * @date :create in 2018/12/27
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
@EnableWebSocket
 | 
			
		||||
@@ -16,6 +15,6 @@ public class WebSocketConfig implements WebSocketConfigurer {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
 | 
			
		||||
        registry.addHandler(new CustomerHandler(), "/socket").addInterceptors(new CustomHandshakeInterceptor());
 | 
			
		||||
        registry.addHandler(new CustomHandler(), "/socket").addInterceptors(new CustomHandshakeInterceptor());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user