riku
2021-06-30 63d16d75a6f12e783bb36cfe526d9cb518b48823
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.flightfeather.uav.lightshare.web
 
import com.flightfeather.uav.lightshare.service.ElectricityService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
 
@Api(tags = ["企业用电量API接口"])
@RestController
@RequestMapping("electric/data")
class ElectricityController (private val electricityService: ElectricityService) {
 
    @ApiOperation(value = "获取企业用电量分钟均值")
    @GetMapping("/minute")
    fun getMinuteData(
        @ApiParam("设备编号") @RequestParam(value = "deviceCode") deviceCode: String,
        @ApiParam(value = "开始时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "startTime", required = false) startTime: String?,
        @ApiParam(value = "结束时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "endTime", required = false) endTime: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getMinuteData(deviceCode, startTime, endTime, page, perPage)
}