fix(ops): 修复 AreaDeviceController RPC 接口不支持 relationType 为空的查询
This commit is contained in:
@@ -45,14 +45,21 @@ public class AreaDeviceController {
|
||||
return success(BeanUtils.toBean(relations, AreaDeviceDTO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/{areaId}/devices")
|
||||
@Operation(summary = "查询区域设备列表(按类型)")
|
||||
public CommonResult<List<AreaDeviceDTO>> getDevicesByAreaAndType(
|
||||
@PathVariable("areaId") Long areaId,
|
||||
@RequestParam("relationType") String relationType) {
|
||||
List<OpsAreaDeviceRelationDO> relations = areaDeviceService.listByAreaIdAndType(areaId, relationType);
|
||||
return success(BeanUtils.toBean(relations, AreaDeviceDTO.class));
|
||||
}
|
||||
@GetMapping("/{areaId}/devices")
|
||||
@Operation(summary = "查询区域设备列表(按类型)")
|
||||
public CommonResult<List<AreaDeviceDTO>> getDevicesByAreaAndType(
|
||||
@PathVariable("areaId") Long areaId,
|
||||
@RequestParam(value = "relationType", required = false) String relationType) {
|
||||
|
||||
List<OpsAreaDeviceRelationDO> relations;
|
||||
if (relationType != null) {
|
||||
relations = areaDeviceService.listByAreaIdAndType(areaId, relationType);
|
||||
} else {
|
||||
relations = areaDeviceService.listByAreaId(areaId);
|
||||
}
|
||||
|
||||
return success(BeanUtils.toBean(relations, AreaDeviceDTO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/device/{deviceId}/relation")
|
||||
@Operation(summary = "查询设备的关联关系")
|
||||
|
||||
Reference in New Issue
Block a user