13693261870
2024-10-31 f7c642eed8ae076553f95a1f0ac5fd2e7c31b6a1
src/main/java/com/se/simu/controller/WaterController.java
@@ -1,6 +1,7 @@
package com.se.simu.controller;
import com.se.simu.domain.po.SimuPo;
import com.se.simu.domain.vo.R;
import com.se.simu.helper.WebHelper;
import com.se.simu.service.SimuService;
import com.se.simu.service.WaterService;
@@ -28,7 +29,7 @@
@Slf4j
@RestController
@RequestMapping("/waterlogging")
public class WaterController {
public class WaterController extends BaseController {
    @Resource
    SimuService simuService;
@@ -134,7 +135,7 @@
            @ApiImplicitParam(name = "y", value = "Y", dataType = "double", paramType = "query", example = "39.8868915"),
            @ApiImplicitParam(name = "timestamp", value = "时间戳", dataType = "long", paramType = "query", example = "1730217660000")
    })
    public Double getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) {
    public R<Double> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) {
        try {
            SimuPo simu = simuService.getSimuByServiceName(serviceName);
            if (null == simu) {
@@ -142,10 +143,10 @@
            }
            // 根据服务名+时间戳+坐标,查询对应的积水深度
            return waterService.getWaterHeight(simu, x, y, timestamp);
            return success(waterService.getWaterHeight(simu, x, y, timestamp));
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            return null;
            return fail(ex);
        }
    }