feiyu02
2024-01-26 01eae19a4870033e879a3faa6749eece92926cab
src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt
@@ -1,9 +1,13 @@
package com.flightfeather.uav.lightshare.web
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
@Api(tags = ["走航监测数据API接口"])
@RestController
@RequestMapping("air/realtime")
class RealTimeDataController(val realTimeDataService: RealTimeDataService) {
@@ -13,9 +17,10 @@
        @RequestParam(value = "deviceCode", required = false) deviceCode: String?,
        @RequestParam(value = "startTime", required = false) startTime: String?,
        @RequestParam(value = "endTime", required = false) endTime: String?,
        @ApiParam(value = "0: 秒级值; 1:分钟值", defaultValue = "0") @RequestParam(value = "type", required = false) type: Int?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = realTimeDataService.getSecondData(deviceCode, startTime, endTime, page, perPage)
    ) = realTimeDataService.getSecondData(deviceCode, startTime, endTime, type, page, perPage)
    @GetMapping("/sec/next")
    fun getNextData(
@@ -29,4 +34,10 @@
    fun importData(
        @RequestPart("excel") file: MultipartFile
    ) = realTimeDataService.importData(file)
    @ApiOperation(value = "导入静安区生态环境监测站的走行数据")
    @PostMapping("/import/jinan")
    fun importJinanData(
        @RequestPart("excel") file: MultipartFile
    ) = realTimeDataService.importJinanData(file)
}