This commit is contained in:
2025-09-27 17:41:43 +08:00
parent fe3e24b945
commit 96b396500e
10 changed files with 76 additions and 84 deletions

View File

@@ -12,7 +12,6 @@ import org.springframework.context.ConfigurableApplicationContext;
public class ErpClientSbApplication {
public static void main(String[] args) {
// 纯 Spring Boot 启动,不再依赖 JavaFX
ConfigurableApplicationContext applicationContext = SpringApplication.run(ErpClientSbApplication.class, args);
try {
ErrorReporter errorReporter = applicationContext.getBean(ErrorReporter.class);
@@ -20,12 +19,11 @@ public class ErpClientSbApplication {
log.error("捕获到未处理异常: " + ex.getMessage(), ex);
errorReporter.reportSystemError("未捕获异常: " + thread.getName(), (Exception) ex);
});
log.info("全局异常处理器已设置");
log.info("Started Success");
} catch (Exception e) {
log.warn("未设置 ErrorReporter继续启动: {}", e.getMessage());
}
// 如需预加载资源,可按需保留
try {
ResourcePreloader.init();
ResourcePreloader.preloadErpDashboard();

View File

@@ -1,9 +1,7 @@
package com.tashow.erp.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import com.tashow.erp.utils.ApiForwarder;
import com.tashow.erp.utils.DeviceUtils;
import java.util.Map;
@@ -16,12 +14,6 @@ import java.util.HashMap;
@RestController
public class DeviceProxyController {
@Autowired
private RestTemplate restTemplate;
@Value("${api.server.base-url}")
private String serverBaseUrl;
/**
* 注册设备
*/
@@ -34,9 +26,6 @@ public class DeviceProxyController {
deviceData.put("deviceId", DeviceUtils.generateDeviceId());
return apiForwarder.post("/monitor/device/register", deviceData, auth);
}
@PostMapping("/api/device/remove")
public ResponseEntity<?> deviceRemove(@RequestBody Map<String, Object> body, @RequestHeader(value = "Authorization", required = false) String auth) {
return apiForwarder.post("/monitor/device/remove", body, auth);