|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/** |
|
|
|
* Copyright © 2016-2021 The Thingsboard Authors |
|
|
|
* Copyright © 2016-2022 The Thingsboard Authors |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -74,6 +74,7 @@ import org.thingsboard.server.dao.exception.IncorrectParameterException; |
|
|
|
import org.thingsboard.server.dao.model.ModelConstants; |
|
|
|
import org.thingsboard.server.queue.util.TbCoreComponent; |
|
|
|
import org.thingsboard.server.service.device.DeviceBulkImportService; |
|
|
|
import org.thingsboard.server.service.gateway_device.GatewayNotificationsService; |
|
|
|
import org.thingsboard.server.service.importing.BulkImportRequest; |
|
|
|
import org.thingsboard.server.service.importing.BulkImportResult; |
|
|
|
import org.thingsboard.server.service.security.model.SecurityUser; |
|
|
|
@ -128,6 +129,8 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
private final DeviceBulkImportService deviceBulkImportService; |
|
|
|
|
|
|
|
private final GatewayNotificationsService gatewayNotificationsService; |
|
|
|
|
|
|
|
@ApiOperation(value = "Get Device (getDeviceById)", |
|
|
|
notes = "Fetch the Device object based on the provided Device Id. " + |
|
|
|
"If the user has the authority of 'TENANT_ADMIN', the server checks that the device is owned by the same tenant. " + |
|
|
|
@ -263,6 +266,7 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
deviceService.deleteDevice(getCurrentUser().getTenantId(), deviceId); |
|
|
|
|
|
|
|
gatewayNotificationsService.onDeviceDeleted(device); |
|
|
|
tbClusterService.onDeviceDeleted(device, null); |
|
|
|
|
|
|
|
logEntityAction(deviceId, device, |
|
|
|
|