feiyu02
2024-08-15 196bb14112448857a885e32dc4149e308e00b01a
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
@@ -58,4 +59,39 @@
        @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)
}