From 196bb14112448857a885e32dc4149e308e00b01a Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 15 八月 2024 11:57:15 +0800
Subject: [PATCH] 2024.8.15 各项修正

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt |   61 ++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
index 418d5a7..4940711 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
@@ -1,5 +1,6 @@
 package cn.flightfeather.supervision.lightshare.web
 
+import cn.flightfeather.supervision.domain.entity.VocPurifyDevice
 import cn.flightfeather.supervision.lightshare.service.DeviceService
 import cn.flightfeather.supervision.lightshare.vo.DateVo
 import io.swagger.annotations.Api
@@ -15,46 +16,82 @@
     @ApiOperation(value = "鑾峰彇鍑�鍖栬澶囦俊鎭�")
     @GetMapping("/purify/info")
     fun getPurifyDeviceInfo(
-            @RequestParam("userId") userId: String
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
     ) = deviceService.getPurifyDeviceInfo(userId)
 
     @ApiOperation(value = "鑾峰彇鐩戞祴璁惧淇℃伅")
     @GetMapping("/monitor/info")
     fun getMonitorDeviceInfo(
-            @RequestParam("userId") userId: String
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
     ) = deviceService.getMonitorDeviceInfo(userId)
 
     @ApiOperation(value = "鑾峰彇鐢ㄦ埛鐩戞祴璁惧鐨勫垎閽熸暟鎹�", notes = "鐩墠榛樿杩斿洖鏈�鏂扮殑15鏉℃暟鎹紝鎸夋椂闂村崌搴忔帓鍒�")
     @GetMapping("/min/value")
     fun getLatestMinuteValue(
-            @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
     ) = deviceService.getLatestMinuteValue(userId)
 
     @ApiOperation(value = "鑾峰彇鐢ㄦ埛鐩戞祴璁惧鐨勫皬鏃舵暟鎹�", notes = "榛樿杩斿洖鏈�鏂扮殑15灏忔椂鏁版嵁, 鎸夋椂闂村崌搴忔帓鍒�")
     @GetMapping("/hour/value")
     fun getLatestHourValue(
-            @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
     ) = deviceService.getLatestHourValue(userId)
 
+    @ApiOperation(value = "鑾峰彇鏈堝害鍧囧�兼暟鎹�")
     @PostMapping("/avg/mon/value")
     fun getMonAvgData(
-            @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
-            @ApiParam(value = "鏃堕棿") @RequestBody timeList: List<DateVo>
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "鏃堕棿") @RequestBody timeList: List<DateVo>
     ) = deviceService.getMonAvgData(userId, timeList)
 
     @ApiOperation(value = "鑾峰彇鐢ㄦ埛鐩戞祴璁惧鐨勫巻鍙叉暟鎹�", notes = "")
     @GetMapping("/history/value")
     fun getHistoryValue(
-            @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
-            @ApiParam(value = "寮�濮嬫椂闂�", example = "yyyy-MM-dd HH:mm") @RequestParam("startTime") startTime: String,
-            @ApiParam(value = "缁撴潫鏃堕棿", example = "yyyy-MM-dd HH:mm") @RequestParam("endTime") endTime: String,
-            @ApiParam(value = "閲囨牱鍛ㄦ湡, 0锛氬垎閽熷潎鍊�;1锛氬皬鏃跺潎鍊�;(鐩墠鍙敮鎸佸垎閽熷潎鍊�)", allowableValues = "0") @RequestParam("period") period: Byte
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "寮�濮嬫椂闂�", example = "yyyy-MM-dd HH:mm") @RequestParam("startTime") startTime: String,
+        @ApiParam(value = "缁撴潫鏃堕棿", example = "yyyy-MM-dd HH:mm") @RequestParam("endTime") endTime: String,
+        @ApiParam(value = "閲囨牱鍛ㄦ湡", example = "0锛氬垎閽熷潎鍊硷紱1锛氬皬鏃跺潎鍊�;(鐩墠鍙敮鎸佸垎閽熷潎鍊�)") @RequestParam("period") period: Byte
     ) = deviceService.getHistoryValue(userId, startTime, endTime, period)
 
     @ApiOperation(value = "鑾峰彇姣忎釜鐩戞祴璁惧鐨勬渶鏂板垎閽熸暟鎹�", notes = "")
     @GetMapping("/min/value/real_time")
     fun getRealTimeData(
-            @ApiParam(value = "椤垫暟") @RequestParam("page") page: Int,
-            @ApiParam(value = "姣忛〉鏁版嵁閲�") @RequestParam("per_page") perPage: Int
+        @ApiParam(value = "椤垫暟") @RequestParam("page") page: Int,
+        @ApiParam(value = "姣忛〉鏁版嵁閲�") @RequestParam("per_page") perPage: Int
     ) = deviceService.getRealTimeData(page, perPage)
+
+    @ApiOperation(value = "鑾峰彇闈欏畨宸ュ湴鎵皹灏忔椂鏁版嵁")
+    @GetMapping("/dust/jingan/value")
+    fun getJingAnDustHourValue(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "寮�濮嬫椂闂�", example = "yyyy-MM-dd HH:mm") @RequestParam("startTime") startTime: String?,
+        @ApiParam(value = "缁撴潫鏃堕棿", example = "yyyy-MM-dd HH:mm") @RequestParam("endTime") endTime: String?,
+    ) = deviceService.getJingAnDustHourValue(userId, startTime, endTime)
+
+    @ApiOperation(value = "鑾峰彇闈欏畨椁愰ギ鏁版嵁")
+    @GetMapping("/fume/jingan/value")
+    fun getJingAnFumeValue(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "寮�濮嬫椂闂�", example = "yyyy-MM-dd HH:mm") @RequestParam("startTime") startTime: String?,
+        @ApiParam(value = "缁撴潫鏃堕棿", example = "yyyy-MM-dd HH:mm") @RequestParam("endTime") endTime: String?,
+    ) = deviceService.getJingAnFumeValue(userId, startTime, endTime)
+
+    @ApiOperation(value = "鑾峰彇璁惧淇℃伅")
+    @GetMapping("/monitor/deviceInfo")
+    fun getDeviceInfo(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+    ) = deviceService.getDeviceInfo(userId)
+
+    @ApiOperation(value = "涓婁紶voc澶勭悊璁惧淇℃伅")
+    @PostMapping("/voc/upload")
+    fun saveVOCPurifyDevice(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "鏃堕棿") @RequestBody infoList: List<VocPurifyDevice>,
+    ) = deviceService.saveVOCPurifyDevice(userId, infoList)
+
+    @ApiOperation(value = "鑾峰彇VOC鍑�鍖栬澶囦俊鎭�")
+    @GetMapping("/voc/purify/info")
+    fun getVOCPurifyDevice(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
+    ) = deviceService.getVOCPurifyDevice(userId)
 }
\ No newline at end of file

--
Gitblit v1.9.3