| | |
| | | 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; |
| | |
| | | @ApiImplicitParam(name = "timestamp", value = "时间戳", dataType = "long", paramType = "query", example = "1730217660000") |
| | | }) |
| | | @GetMapping("/{serviceName}/getWaterHeight") |
| | | public R<Double> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) { |
| | | 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; |
| | | } |
| | | |
| | | // 根据服务名+时间戳+坐标,查询对应的积水深度 |
| | | return success(waterService.getWaterHeight(simu, x, y, timestamp)); |
| | | 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); |