chenxiaofei 4 часов назад
Родитель
Сommit
ad60b5ca8d

+ 2 - 2
iot-platform-manager/src/main/java/com/platform/api/controller/WeighbridgeController.java

@@ -33,7 +33,7 @@ public class WeighbridgeController {
     /**
      * 地磅过磅数据上报
      */
-    @Operation(summary = "地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
+    @Operation(summary = "630地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
     @PostMapping("/weighBridgePush")
     public LicensePlateValidateResponse weighBridgePush(
             @Parameter(description = "车牌号") @RequestParam("licensePlate") String licensePlate,
@@ -67,7 +67,7 @@ public class WeighbridgeController {
     @PostMapping("/validateLicensePlate")
     public LicensePlateValidateResponse validateLicensePlate(
             @Parameter(description = "车牌号") @RequestParam("licensePlate") String licensePlate,
-            @Parameter(description = "厂商来源标识") @RequestParam("uuid") String uuid
+            @RequestHeader(value = "uuid", required = false)  String uuid
     ) {
         LicensePlateValidateRequest request = new LicensePlateValidateRequest();
         String replac2 = "";

+ 1 - 1
iot-platform-manager/src/main/java/com/platform/api/controller/WeighbridgeV2Controller.java

@@ -45,7 +45,7 @@ public class WeighbridgeV2Controller {
     /**
      * 地磅过磅数据上报
      */
-    @Operation(summary = "地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
+    @Operation(summary = "630地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
     @PostMapping("/weighBridgePushJd")
     public LicensePlateValidateResponse weighBridgePush(
             @Parameter(description = "车牌号") @RequestParam("licensePlate") String licensePlate,

+ 0 - 44
iot-platform-manager/src/test/java/com/platform/api/manager/UploadServiceTest.java

@@ -1,44 +0,0 @@
-package com.platform.api.manager;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.test.util.ReflectionTestUtils;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class UploadServiceTest {
-
-    @Test
-    void processBase64ImagesToLocalAsyncShouldExtractDataUrlPayload() throws Exception {
-        UploadService uploadService = new UploadService();
-        Path storagePath = Files.createTempDirectory("weighbridge-images");
-        ReflectionTestUtils.setField(uploadService, "imageStoragePath", storagePath.toString());
-
-        String image = "\"data:image/png;base64,iVBORw0KGgo=\\n\"]}";
-        String savedPath = uploadService.processBase64ImagesToLocalAsync(List.of(image), "test")
-                .get();
-
-        Path path = Path.of(savedPath);
-        assertTrue(Files.exists(path));
-        assertTrue(path.getFileName().toString().endsWith(".png"));
-        assertArrayEquals(new byte[]{
-                (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A
-        }, Files.readAllBytes(path));
-    }
-
-    @Test
-    void processBase64ImagesToLocalAsyncShouldHandleSpaceConvertedPlusSign() throws Exception {
-        UploadService uploadService = new UploadService();
-        Path storagePath = Files.createTempDirectory("weighbridge-images");
-        ReflectionTestUtils.setField(uploadService, "imageStoragePath", storagePath.toString());
-
-        String savedPath = uploadService.processBase64ImagesToLocalAsync(List.of("data:image/jpeg;base64, w=="), "test")
-                .get();
-
-        assertArrayEquals(new byte[]{(byte) 0xFB}, Files.readAllBytes(Path.of(savedPath)));
-    }
-}