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.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; import com.moral.api.pojo.dto.dataDisplay.HeatMapDTO; import com.moral.api.service.DataDisplayService; import com.moral.api.utils.HeatMapTimeUtils; import com.moral.api.vo.HeatMapVo; 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 = "organizationId",name = "组织id") Integer id, @RequestParam @ApiParam(value = "startTime",name = "开始时间") String startTime, @RequestParam @ApiParam(value = "type",name= "因子类型") String type, @RequestParam @ApiParam(value = "form",name= "时间类型") String form, @RequestParam @ApiParam(value = "monitorId",name= "站点id") Integer monitorId){ List heatMapData = dataDisplayService.getHeatMapDataV2(id, startTime, type, form,monitorId); return ResultMessage.ok(ObjectUtils.isEmpty(heatMapData)?"0":heatMapData); } @GetMapping("queryTime") @ApiOperation("查询时间") public ResultMessage getHeatMap(@RequestParam @ApiParam(value = "startTime",name = "开始时间") String startTime, @RequestParam @ApiParam(value = "endTime",name= "结束类型") String endTime, @RequestParam @ApiParam(value = "type",name= "时间类型") String type){ List heatMapVos = HeatMapTimeUtils.getTime(startTime, endTime, type); return ResultMessage.ok(ObjectUtils.isEmpty(heatMapVos)?"0":heatMapVos); } }