jinpengyong
2023-12-12 0e65824734f68f4c18370204a8c574b4514939b6
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
package com.moral.api.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
 
import com.moral.api.service.DataDisplayService;
import com.moral.constant.ResultMessage;
 
/**
 * Description //todo
 *
 * @author swb
 * @ClassName HeatMapController
 * @date 2023.12.11 15:20
 */
@Slf4j
@Api(tags = {"区域热力图"})
@RestController
@RequestMapping("/heatMap")
public class HeatMapController {
 
 
    @Autowired
    private DataDisplayService dataDisplayService;
 
 
     @GetMapping("query")
     @ApiOperation("热力图显示")
     public ResultMessage  getHeatMap(@RequestParam @ApiParam(value = "code",name = "区域码") String code,
                                      @RequestParam @ApiParam(value = "startTime",name = "开始时间") String startTime,
                                      @RequestParam @ApiParam(value = "type",name= "因子类型") String type,
                                      @RequestParam @ApiParam(value = "form",name= "时间类型") String form){
         ArrayList<Map<String, Object>> heatMapData = dataDisplayService.getHeatMapData(code, startTime, type, form);
         return ResultMessage.ok(ObjectUtils.isEmpty(heatMapData)?"0":heatMapData);
     }
}