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