lxw
2023-04-25 b13bc9c38bae9e9619cb2c87481808c5a35c12ef
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.UserInf;
import com.whyc.service.BattEnduranceService;
import com.whyc.util.ActionUtil;
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;
 
import javax.annotation.Resource;
 
@RestController
@RequestMapping("battEndurance")
@Api(tags = "数据管理-电池信息统计分析-续航")
public class BattEnduranceController {
    @Resource
    private BattEnduranceService service;
 
    @GetMapping("/getEndurance")
    @ApiOperation(value = "设备续航统计")
    public Response getEndurance(){
        UserInf userInf = ActionUtil.getUser();
        return service.getEndurance(userInf.getUId().intValue());
    }
    @GetMapping("/getBattInfEnduranceByTimeCode")
    @ApiOperation(value = "电池及续航信息",notes = "根据续航时段查询电池及续航信息 timeCode:1->小于1,2-> 1~2,3-> 2~3,4-> 3~5,5-> 5~8,6-> 大于8")
    public Response getBattInfEnduranceByTimeCode(@RequestParam int timeCode){
        UserInf userInf = ActionUtil.getUser();
        return service.getBattInfEnduranceByTimeCode(userInf.getUId().intValue(),timeCode);
    }
    @GetMapping("/getEnduranceTimeByDeviceId")
    @ApiOperation(value = "根据设备id获取实际续航")
    public Response getEnduranceTimeByDeviceId(@RequestParam int deviceId){
        return service.getEnduranceTimeByDeviceId(deviceId);
    }
 
    @GetMapping("/enableEndurance")
    @ApiOperation(value = "启动续航线程",notes = "ThreadUtilAction!enableEndurance启动续航统计")
    public Response enableEndurance(){
        return service.enableEndurance();
    }
 
}