zhanghua
2023-05-30 f186f661e0ef88ad43c20c272621e8c7506e7b82
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
package com.ycl.controller.trend;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ycl.api.CommonResult;
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.service.trend.TrendAnalysisService;
import com.ycl.vo.TrendAnalysisVo;
import com.ycl.vo.TrendVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@Api(tags = "趋势分析")
@RestController
@RequestMapping("/trendAnalysis")
public class TrendAnalysisController {
    @Autowired
    TrendAnalysisService trendAnalysisService;
 
    @ApiOperation("数据查询")
    @PostMapping("/info")
    public CommonResult<List<TrendVo>> list(@RequestBody TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) {
        return CommonResult.success(trendAnalysisService.list(trendAnalysisParam, pageSize, pageNum));
    }
 
    @ApiOperation("点位数据查询")
    @GetMapping("/pointInfo")
    public CommonResult<List<TrendVo>> queryPointInfo(@RequestParam(required = false) String longitude,
                                                      @RequestParam(required = false) String latitude) {
        return CommonResult.success(trendAnalysisService.queryPointInfo(longitude, latitude));
    }
 
    @ApiOperation("点位数据查询")
    @GetMapping("/queryPointInfoByTime")
    public CommonResult<TrendAnalysisVo> queryPointInfoByTime(@RequestParam Long pointId,
                                                              @RequestParam(required = false) String startTime,
                                                              @RequestParam(required = false) String endTime) {
        return CommonResult.success(trendAnalysisService.queryPointInfoByTime(pointId, startTime, endTime));
    }
 
    @ApiOperation("首次报警点位数据查询")
    @PostMapping("/firstInfo")
    public CommonResult<List<TrendVo>> queryListByCount(@RequestBody TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) {
        return CommonResult.success(trendAnalysisService.queryListByCount(trendAnalysisParam, pageSize, pageNum));
    }
}