cjl
2023-10-25 090f4dac98c412c5734a706b853724e2d2accda4
screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java
@@ -1,20 +1,25 @@
package com.moral.api.controller;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.moral.api.pojo.dto.historyFiveMinutely.DeviceAndFiveMinuteDataDTO;
import com.moral.api.pojo.form.historyFiveMinutely.QueryDeviceAndFiveMinuteDataForm;
import com.moral.api.pojo.vo.historyFiveMinutely.DeviceAndFiveMinuteDataVO;
import com.moral.api.pojo.vo.historyFiveMinutely.QueryFiveDataByMacVO;
import com.moral.api.service.HistoryFiveMinutelyService;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
import com.moral.util.WebUtils;
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.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
@@ -81,6 +86,23 @@
        }
        return  ResultMessage.ok(popDataByMac);
    }
    @GetMapping("queryFiveDataByMac")
    @ApiOperation("新五分钟数据弹框")
    public ResultMessage queryFiveDataByMac(@RequestParam @ApiParam(value = "mac",name = "mac号") String mac,
                                            @RequestParam @ApiParam(value = "chooseTime",name = "选取历史数据") String chooseTime,
                                            @RequestParam @ApiParam(value = "time",name = "时间") String time){
        QueryFiveDataByMacVO queryFiveDataByMacVO = historyFiveMinutelyService.queryFiveDataByMac(mac, chooseTime, time);
        if (ObjectUtils.isEmpty(queryFiveDataByMacVO)){
            return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(), ResponseCodeEnum.TARGET_IS_NULL.getMsg());
}
        return  ResultMessage.ok(queryFiveDataByMacVO);
    }
}