13693261870
2024-07-16 b8aebfe8bcb9ce03a45f151078f565a00a02036f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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;
    }
}