feat: 为多个服务添加缓存支持 fix: 修复WebSocket任务管理和远程调用异常处理 refactor: 重命名CompanyVendorFileType为VendorFileType refactor: 优化项目成本导入任务实现 fix: 修复ContractTabSkinBase中的空指针问题 refactor: 统一WebSocket客户端任务调用接口
30 lines
822 B
Java
30 lines
822 B
Java
package com.ecep.contract;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import java.util.Locale;
|
|
import java.util.logging.Level;
|
|
|
|
public interface WebSocketClientTasker {
|
|
String getTaskName();
|
|
|
|
void updateMessage(Level level, String message);
|
|
|
|
void updateTitle(String title);
|
|
|
|
void updateProgress(long current, long total);
|
|
|
|
default Object callRemoteTask(MessageHolder holder, Locale locale, Object... args) {
|
|
WebSocketClientService webSocketService = SpringApp.getBean(WebSocketClientService.class);
|
|
webSocketService.withSession(session -> {
|
|
try {
|
|
session.submitTask(this, locale, args);
|
|
} catch (JsonProcessingException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
});
|
|
|
|
return null;
|
|
}
|
|
}
|