13693261870
2024-07-16 b8aebfe8bcb9ce03a45f151078f565a00a02036f
添加服务类
已添加1个文件
已修改1个文件
47 ■■■■■ 文件已修改
src/main/java/com/se/simu/controller/WaterController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/service/WaterService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/controller/WaterController.java
@@ -1,10 +1,15 @@
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;
/**
 * å†…涝控制器
@@ -13,13 +18,40 @@
 * @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;
    }
}
src/main/java/com/se/simu/service/WaterService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.se.simu.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * å†…涝服务类
 *
 * @author WWW
 * @date   2024-07-16
 */
@Slf4j
@Service
public class WaterService {
}