月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-08-23 b11f32e0bd83f4adeee377133e073bdd90aa2792
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package com.moon.server.controller.data;
 
import com.moon.server.annotation.SysLog;
import com.moon.server.controller.all.BaseController;
import com.moon.server.entity.all.ResponseMsg;
import com.moon.server.helper.WebHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * 栅格分析
 * @author WWW
 * @date   2023-08-23
 */
@Api(tags = "数据管理\\栅格分析")
@RestController
@RequestMapping("/rasterAnalysis")
public class RasterAnalysisController extends BaseController {
    @SysLog()
    @ApiOperation(value = "查询点分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "点WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/selectByPoint")
    public ResponseMsg<Object> selectByPoint(String wkt) {
        try {
            Map<String, Double> map = new HashMap<>(5);
            map.put("图层名", 0.0);
 
            return success(map);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "查询线分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/selectByPolyline")
    public ResponseMsg<Object> selectByPolyline(String wkt) {
        try {
            Map<String, List<Double>> map = new HashMap<>(5);
            List<Double> list = new ArrayList<>();
            list.add(0.0);
            map.put("图层名", list);
 
            return success(map);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "查询面分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "面WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/selectByPolygon")
    public ResponseMsg<Object> selectByPolygon(String wkt) {
        try {
            Map<String, Double> map = new HashMap<>(5);
            map.put("图层名", 0.0);
 
            return success(map);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "下载点分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "点WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/downloadByPoint")
    public void downloadByPoint(String wkt, HttpServletResponse res) {
        try {
            // ...
 
            String filePath = "生成文件的路径";
            WebHelper.download(filePath, "文件名", res);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "下载线分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/downloadByPolyline")
    public void downloadByPolyline(String wkt, HttpServletResponse res) {
        try {
            // ...
 
            String filePath = "生成文件的路径";
            WebHelper.download(filePath, "文件名", res);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "下载面分析")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "面WKT", dataType = "String", example = "")
    })
    @GetMapping(value = "/downloadByPolygon")
    public void downloadByPolygon(String wkt, HttpServletResponse res) {
        try {
            // ...
 
            String filePath = "生成文件的路径";
            WebHelper.download(filePath, "文件名", res);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
}