From 9bf891d878ae6edabc770609350daa60d8c41d8b Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 27 Oct 2023 17:03:38 +0800
Subject: [PATCH] fix:管理员登陆
---
screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java | 64 +++++++++++++++++++++++++++++--
1 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java b/screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java
index c11637f..f4e80b9 100644
--- a/screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java
@@ -1,20 +1,32 @@
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;
import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
/**
* @ClassName HistoryFiveMinutely
@@ -34,21 +46,63 @@
@Autowired
HistoryFiveMinutelyService historyFiveMinutelyService;
+ /**
+ * @Description: ���������������������������������������������������������������������
+ * @Param: [form]
+ * @return: com.moral.constant.ResultMessage
+ * @Author: ���������
+ * @Date: 2022/3/10
+ */
@GetMapping("queryDeviceAndData")
public ResultMessage queryDeviceAndData(QueryDeviceAndFiveMinuteDataForm form){
- //18 110100
//������������������������
if (!form.valid())
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+
//������������������
- List<DeviceAndFiveMinuteDataDTO> dto = historyFiveMinutelyService.queryDeviceAndFiveMinuteData(form);
-
+ List<Map<String, Object>> dto = historyFiveMinutelyService.queryDeviceAndFiveMinuteData(form);
+ Map<String,List<Map<String, Object>>> dtoResult = new HashMap<>();
+ dtoResult.put("devices",dto);
//������������������
- DeviceAndFiveMinuteDataVO vo = DeviceAndFiveMinuteDataVO.convert(dto);
+ //DeviceAndFiveMinuteDataVO vo = DeviceAndFiveMinuteDataVO.convert(dto);
- return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(), vo);
+ return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(), dtoResult);
}
+
+ /**
+ * @Description: ���������������������������������
+ * @Param: [mac]
+ * @return: com.moral.constant.ResultMessage
+ * @Author: ���������
+ * @Date: 2022/3/10
+ */
+ @GetMapping("queryPopDataByMac")
+ public ResultMessage queryPopDataByMac(HttpServletRequest request){
+ Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
+ Map<String, Object> popDataByMac = historyFiveMinutelyService.getPopDataByMac(params);
+ if (popDataByMac==null){
+ return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(), ResponseCodeEnum.TARGET_IS_NULL.getMsg());
+ }
+ 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);
+ }
+
+
+
}
+
--
Gitblit v1.8.0