package com.gz.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * WebSocket 扫描 配置
 * @author LiuchangLan
 * @date 2020/8/7 9:50
 */
@Slf4j
@Configuration
public class WebSocketConfig {

    /**
     * ServerEndpointExporter 作用
     * 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
     * @return
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        log.info("加载ServerEndpoint扫描");
        return new ServerEndpointExporter();
    }
}
