chore: 优化部分代码

This commit is contained in:
2024-06-05 19:45:09 +08:00
parent cc079e8bf4
commit 5cd6af8e7b
14 changed files with 13 additions and 16 deletions

View File

@@ -46,7 +46,7 @@ import top.continew.starter.messaging.websocket.dao.WebSocketSessionDaoDefaultIm
@AutoConfiguration
@EnableWebSocket
@EnableConfigurationProperties(WebSocketProperties.class)
@ConditionalOnProperty(prefix = PropertiesConstants.MESSAGING_WEBSOCKET, name = PropertiesConstants.ENABLED, havingValue = "true")
@ConditionalOnProperty(prefix = PropertiesConstants.MESSAGING_WEBSOCKET, name = PropertiesConstants.ENABLED, matchIfMissing = true)
public class WebSocketAutoConfiguration {
private static final Logger log = LoggerFactory.getLogger(WebSocketAutoConfiguration.class);

View File

@@ -39,7 +39,7 @@ public class WebSocketProperties {
/**
* 是否启用 WebSocket
*/
private boolean enabled = false;
private boolean enabled = true;
/**
* 路径

View File

@@ -16,8 +16,6 @@
package top.continew.starter.messaging.websocket.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
@@ -37,7 +35,6 @@ import java.util.Map;
*/
public class WebSocketInterceptor extends HttpSessionHandshakeInterceptor {
private static final Logger log = LoggerFactory.getLogger(WebSocketInterceptor.class);
private final WebSocketProperties webSocketProperties;
private final CurrentUserProvider currentUserProvider;