refactor: 重构WebSocket服务及相关实体类
重构WebSocket服务名称从WebSocketService改为WebSocketClientService,并实现Serializable接口 添加WebSocket常量定义和消息处理实现 优化实体类equals和hashCode方法 修复控制器路径和日志配置 添加查询服务和任务接口方法
This commit is contained in:
@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ecep.contract.Desktop;
|
||||
import com.ecep.contract.DesktopUtils;
|
||||
import com.ecep.contract.WebSocketService;
|
||||
import com.ecep.contract.WebSocketClientService;
|
||||
import com.ecep.contract.controller.bank.BankManagerWindowController;
|
||||
import com.ecep.contract.controller.company.CompanyManagerWindowController;
|
||||
import com.ecep.contract.controller.contract.ContractManagerWindowController;
|
||||
@@ -101,7 +101,7 @@ public class HomeWindowController extends BaseController {
|
||||
Desktop.instance.getTaskMonitorCenter().bindStatusLabel(taskMonitorLabel);
|
||||
Desktop.instance.getActiveEmployee().initialize();
|
||||
|
||||
WebSocketService webSocketService = getBean(WebSocketService.class);
|
||||
WebSocketClientService webSocketService = getBean(WebSocketClientService.class);
|
||||
webSocketMonitorIcon.iconProperty()
|
||||
.bind(webSocketService.getOnlineProperty().map(b -> b ? "CHAIN" : "CHAIN_BROKEN"));
|
||||
webSocketMonitorLabel.textProperty().bind(webSocketService.getMessageProperty());
|
||||
@@ -219,7 +219,7 @@ public class HomeWindowController extends BaseController {
|
||||
@Override
|
||||
public void onHidden(WindowEvent windowEvent) {
|
||||
System.out.println("windowEvent = " + windowEvent);
|
||||
WebSocketService webSocketService = getBean(WebSocketService.class);
|
||||
WebSocketClientService webSocketService = getBean(WebSocketClientService.class);
|
||||
webSocketService.closeWebSocket(); // 在窗口隐藏时关闭WebSocket连接
|
||||
super.onHidden(windowEvent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user