From e2988bcd446dfda8cb1be7f15e2afc58bdd4df8c Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 08 十一月 2024 13:41:37 +0800
Subject: [PATCH] 1

---
 src/main/java/com/se/simu/controller/WaterController.java |   51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/se/simu/controller/WaterController.java b/src/main/java/com/se/simu/controller/WaterController.java
index fdeba3f..4df2535 100644
--- a/src/main/java/com/se/simu/controller/WaterController.java
+++ b/src/main/java/com/se/simu/controller/WaterController.java
@@ -1,7 +1,9 @@
 package com.se.simu.controller;
 
 import com.se.simu.domain.po.SimuPo;
+import com.se.simu.domain.vo.PondingVo;
 import com.se.simu.domain.vo.R;
+import com.se.simu.helper.StringHelper;
 import com.se.simu.helper.WebHelper;
 import com.se.simu.service.SimuService;
 import com.se.simu.service.WaterService;
@@ -145,22 +147,65 @@
     }
 
     @ApiOperation(value = "鏍规嵁鍧愭爣鏌ヨ绉按娣卞害")
-    @GetMapping("/{serviceName}/getWaterHeight")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "serviceName", value = "鏈嶅姟鍚�", dataType = "String", paramType = "path", example = "20241010095328"),
             @ApiImplicitParam(name = "x", value = "X", dataType = "double", paramType = "query", example = "116.6447998"),
             @ApiImplicitParam(name = "y", value = "Y", dataType = "double", paramType = "query", example = "39.8868915"),
             @ApiImplicitParam(name = "timestamp", value = "鏃堕棿鎴�", dataType = "long", paramType = "query", example = "1730217660000")
     })
-    public R<Double> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) {
+    @GetMapping("/{serviceName}/getWaterHeight")
+    public R<Object> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) {
         try {
             SimuPo simu = simuService.getSimuByServiceName(serviceName);
             if (null == simu) {
                 return null;
             }
 
+            Double depth = waterService.getWaterHeight(simu, x, y, timestamp);
+            Double area = waterService.getWaterArea(simu, x, y, timestamp);
+
+            return success(new PondingVo(depth, area));
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            return fail(ex);
+        }
+    }
+
+    @ApiOperation(value = "鏍规嵁seid鏌ヨ寤虹瓚鐗╂秹姘存繁搴�")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "serviceName", value = "鏈嶅姟鍚�", dataType = "String", paramType = "path", example = "20241010095328"),
+            @ApiImplicitParam(name = "seid", value = "X", dataType = "String", paramType = "query", example = "5_f128d8b1aba6455c88d2f42334ca62bb")
+    })
+    @GetMapping("/{serviceName}/getBuildingDepthBySeid")
+    public R<Object> getBuildingDepthBySeid(@PathVariable String serviceName, String seid) {
+        try {
+            if (StringHelper.isEmpty(serviceName) || StringHelper.isEmpty(seid)) {
+                return null;
+            }
+
             // 鏍规嵁鏈嶅姟鍚�+鏃堕棿鎴�+鍧愭爣锛屾煡璇㈠搴旂殑绉按娣卞害
-            return success(waterService.getWaterHeight(simu, x, y, timestamp));
+            return success(waterService.getBuildingDepthBySeid(serviceName, seid));
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            return fail(ex);
+        }
+    }
+
+
+    @ApiOperation(value = "鏍规嵁timestamp鏌ヨ寤虹瓚鐗╂秹姘存繁搴�")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "serviceName", value = "鏈嶅姟鍚�", dataType = "String", paramType = "path", example = "20241010095328"),
+            @ApiImplicitParam(name = "timestamp", value = "鏃堕棿鎴�", dataType = "Long", paramType = "query", example = "1730217660000")
+    })
+    @GetMapping("/{serviceName}/getBuildingDepthByTime")
+    public R<Object> getBuildingDepthByTime(@PathVariable String serviceName, Long timestamp) {
+        try {
+            if (StringHelper.isEmpty(serviceName) || null == timestamp) {
+                return null;
+            }
+
+            // 鏍规嵁鏈嶅姟鍚�+鏃堕棿鎴�+鍧愭爣锛屾煡璇㈠搴旂殑绉按娣卞害
+            return success(waterService.getBuildingDepthByTime(serviceName, timestamp));
         } catch (Exception ex) {
             log.error(ex.getMessage(), ex);
             return fail(ex);

--
Gitblit v1.9.3