From 9804628abf554c3658345fc8fc9472cfb179fd5f Mon Sep 17 00:00:00 2001
From: 张洋洋 <10611411+yang-yang-z@user.noreply.gitee.com>
Date: 星期一, 24 二月 2025 22:08:12 +0800
Subject: [PATCH] [add]服务发布

---
 src/main/java/com/se/simu/controller/TestController.java |   82 ++++++++++++++++++++++++++++++++---------
 1 files changed, 64 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/se/simu/controller/TestController.java b/src/main/java/com/se/simu/controller/TestController.java
index 303c543..30a9fc9 100644
--- a/src/main/java/com/se/simu/controller/TestController.java
+++ b/src/main/java/com/se/simu/controller/TestController.java
@@ -2,12 +2,12 @@
 
 import com.se.simu.domain.po.DataPo;
 import com.se.simu.domain.vo.R;
+import com.se.simu.helper.ShpHelper;
 import com.se.simu.helper.StringHelper;
-import com.se.simu.service.GedbService;
-import com.se.simu.service.ResultService;
-import com.se.simu.service.SimuService;
-import com.se.simu.service.UwService;
+import com.se.simu.service.*;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,12 +16,6 @@
 
 import javax.annotation.Resource;
 
-/**
- * Test鎺у埗鍣�
- *
- * @author WWW
- * @date   2024-10-30
- */
 @Api(tags = "Test")
 @Slf4j
 @RestController
@@ -38,6 +32,9 @@
     SimuService simuService;
 
     @Resource
+    Hdf5Service hdf5Service;
+
+    @Resource
     ResultService resultService;
 
     @ApiOperation(value = "褰撳墠鏃堕棿 *")
@@ -47,11 +44,14 @@
     }
 
     @ApiOperation(value = "testCallExe *")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query", example = "20241010095328")
+    })
     @GetMapping("/testCallExe")
-    public R<Object> testCallExe() {
+    public R<Object> testCallExe(String path) {
         try {
             DataPo data = new DataPo();
-            data.setInPath("20241010095328");
+            data.setInPath(path);
 
             String str = uwService.callExe(data);
 
@@ -62,13 +62,17 @@
     }
 
     @ApiOperation(value = "testResuslt *")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query", example = "20241107092342"),
+            @ApiImplicitParam(name = "time", value = "鏃堕棿", dataType = "String", paramType = "query", example = "2024-11-07 09:23:42")
+    })
     @GetMapping("/testResuslt")
-    public R<Object> testResuslt() {
+    public R<Object> testResuslt(String path, String time) {
         try {
             DataPo data = new DataPo();
             data.setEpsg(4548);
-            data.setInPath("20241010095328");
-            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
+            data.setInPath(path);
+            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse(time));
 
             resultService.process(data);
 
@@ -101,15 +105,57 @@
         try {
             DataPo data = new DataPo();
             data.setEpsg(4548);
+            data.setTotal(60.0);
+            data.setDuration(60);
             data.setInPath("20241010095328");
-            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
+            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-07-01 00:00:00"));
 
-            Object rs = uwService.copeDrainFiles(data);
+            uwService.createRainFile(data);
 
-            return success(rs);
+            return success("ok");
         } catch (Exception ex) {
             return fail(ex, null);
         }
     }
 
+    @ApiOperation(value = "testToken *")
+    @GetMapping("/testToken")
+    public R<Object> testToken() {
+        try {
+            String token = gedbService.getToken();
+
+            return success(token);
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
+
+    @ApiOperation(value = "testPolygonize *")
+    @GetMapping("/testPolygonize")
+    public R<Object> testPolygonize() {
+        try {
+            ShpHelper.test();
+
+            return success("ok");
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
+
+    @ApiOperation(value = "testH5 *")
+    @GetMapping("/testH5")
+    public R<Object> testH5() {
+        try {
+            DataPo data = new DataPo();
+            data.setEpsg(4548);
+            data.setInPath("20241010095328");
+            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
+
+            hdf5Service.test(data);
+
+            return success("ok");
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
 }

--
Gitblit v1.9.3