获取设备使用数据

This commit is contained in:
2025-09-09 16:06:34 +08:00
parent 7e87971c0b
commit 832234269d
5 changed files with 32 additions and 26 deletions

View File

@ -61,13 +61,15 @@ public class HomePageController {
/**
* 获取设备使用数据
*
* @param deviceId 设备ID
* @param deviceTypeId 设备ID (可选)
* @param range 时间范围 1:半年 2:一年
* @return 每月使用数据列表
*/
@GetMapping("/getEquipmentUsageData/{deviceId}/{range}")
public R<List<Map<String, Object>>> getEquipmentUsageData(@PathVariable Long deviceId, @PathVariable Integer range) {
return R.ok(deviceService.getEquipmentUsageData(deviceId, range));
@GetMapping("/getEquipmentUsageData/{range}")
public R<List<Map<String, Object>>> getEquipmentUsageData(@PathVariable Integer range,
@RequestParam(required = false) Long deviceTypeId) {
return R.ok(deviceService.getEquipmentUsageData(deviceTypeId, range));
}
}