package com.se.simu.controller; import com.se.simu.service.WaterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * 内涝控制器 * * @author WWW * @date 2024-07-16 */ @Api(tags = "内涝管理") @Slf4j @RestController @RequestMapping("/waterlogging") public class WaterController { @Resource WaterService waterService; @ApiOperation(value = "获取当前时间") @GetMapping("/getTime") public Object getTime() { return System.currentTimeMillis(); } @ApiOperation(value = "获取元数据信息") @GetMapping("/{serviceName}/layer.json") public Object getLayer(@PathVariable String serviceName) { return serviceName; } @ApiOperation(value = "获取地形高度图") @GetMapping("/{serviceName}/terrain?width={width}&height={height}") public Object getTerraMap(@PathVariable String serviceName, @PathVariable Integer width, @PathVariable Integer height) { return serviceName + "," + width + "," + height; } @ApiOperation(value = "获取水面高度图") @GetMapping("/{serviceName}/waterMap?width={width}&height={height}&time={timestamp}") public Object getWaterMap(@PathVariable String serviceName, @PathVariable Integer width, @PathVariable Integer height, @PathVariable Long timestamp) { return serviceName + "," + width + "," + height + "," + timestamp; } @ApiOperation(value = "获取水流向流速图") @GetMapping("/{serviceName}/flowMap?width={width}&height={height}&time={timestamp}") public Object getFlowMap(@PathVariable String serviceName, @PathVariable Integer width, @PathVariable Integer height, @PathVariable Long timestamp) { return serviceName + "," + width + "," + height + "," + timestamp; } }