chore: 优化部分代码写法

This commit is contained in:
2024-09-11 21:23:50 +08:00
parent 0cede6bf9f
commit 1fc80cda9e

View File

@@ -16,7 +16,6 @@
package top.continew.starter.messaging.websocket.autoconfigure; package top.continew.starter.messaging.websocket.autoconfigure;
import cn.hutool.extra.spring.SpringUtil;
import jakarta.annotation.PostConstruct; import jakarta.annotation.PostConstruct;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -65,15 +64,14 @@ public class WebSocketAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public WebSocketHandler webSocketHandler() { public WebSocketHandler webSocketHandler(WebSocketSessionDao webSocketSessionDao) {
return new top.continew.starter.messaging.websocket.core.WebSocketHandler(properties, SpringUtil return new top.continew.starter.messaging.websocket.core.WebSocketHandler(properties, webSocketSessionDao);
.getBean(WebSocketSessionDao.class));
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public HandshakeInterceptor handshakeInterceptor() { public HandshakeInterceptor handshakeInterceptor(WebSocketClientService webSocketClientService) {
return new WebSocketInterceptor(properties, SpringUtil.getBean(WebSocketClientService.class)); return new WebSocketInterceptor(properties, webSocketClientService);
} }
/** /**