package com.qiuguo.iot.box.websocket.api.config;

import com.qiuguo.iot.base.annotation.WebSocketMappingHandleMapping;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.HandlerMapping;
import org.springframework.web.reactive.socket.server.support.WebSocketHandlerAdapter;

@Configuration
public class WebSocketConfig {


    @Bean
    public HandlerMapping handlerMapping() {
        // 对相应的URL进行添加处理器
        return new WebSocketMappingHandleMapping();
    }

    @Bean
    public WebSocketHandlerAdapter handlerAdapter() {
        return new WebSocketHandlerAdapter();
    }
}
