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> heatMapData = dataDisplayService.getHeatMapData(code, startTime, type, form); return ResultMessage.ok(ObjectUtils.isEmpty(heatMapData)?"0":heatMapData); } }