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();
|
}
|
|
}
|