|
|
|
@ -53,7 +53,6 @@ import org.thingsboard.server.common.data.rule.RuleChain; |
|
|
|
import org.thingsboard.server.common.data.sync.ie.importing.csv.BulkImportRequest; |
|
|
|
import org.thingsboard.server.common.data.sync.ie.importing.csv.BulkImportResult; |
|
|
|
import org.thingsboard.server.common.msg.edge.FromEdgeSyncResponse; |
|
|
|
import org.thingsboard.server.common.msg.edge.ToEdgeSyncRequest; |
|
|
|
import org.thingsboard.server.config.annotations.ApiOperation; |
|
|
|
import org.thingsboard.server.dao.exception.DataValidationException; |
|
|
|
import org.thingsboard.server.dao.exception.IncorrectParameterException; |
|
|
|
@ -71,7 +70,6 @@ import org.thingsboard.server.service.security.permission.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -268,7 +266,7 @@ public class EdgeController extends BaseController { |
|
|
|
@RequestParam(required = false) String sortOrder) throws ThingsboardException { |
|
|
|
TenantId tenantId = getCurrentUser().getTenantId(); |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
if (type != null && type.trim().length() > 0) { |
|
|
|
if (type != null && !type.trim().isEmpty()) { |
|
|
|
return checkNotNull(edgeService.findEdgesByTenantIdAndType(tenantId, type, pageLink)); |
|
|
|
} else { |
|
|
|
return checkNotNull(edgeService.findEdgesByTenantId(tenantId, pageLink)); |
|
|
|
@ -295,7 +293,7 @@ public class EdgeController extends BaseController { |
|
|
|
@RequestParam(required = false) String sortOrder) throws ThingsboardException { |
|
|
|
TenantId tenantId = getCurrentUser().getTenantId(); |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
if (type != null && type.trim().length() > 0) { |
|
|
|
if (type != null && !type.trim().isEmpty()) { |
|
|
|
return checkNotNull(edgeService.findEdgeInfosByTenantIdAndType(tenantId, type, pageLink)); |
|
|
|
} else { |
|
|
|
return checkNotNull(edgeService.findEdgeInfosByTenantId(tenantId, pageLink)); |
|
|
|
@ -359,7 +357,7 @@ public class EdgeController extends BaseController { |
|
|
|
checkCustomerId(customerId, Operation.READ); |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
PageData<Edge> result; |
|
|
|
if (type != null && type.trim().length() > 0) { |
|
|
|
if (type != null && !type.trim().isEmpty()) { |
|
|
|
result = edgeService.findEdgesByTenantIdAndCustomerIdAndType(tenantId, customerId, type, pageLink); |
|
|
|
} else { |
|
|
|
result = edgeService.findEdgesByTenantIdAndCustomerId(tenantId, customerId, pageLink); |
|
|
|
@ -394,7 +392,7 @@ public class EdgeController extends BaseController { |
|
|
|
checkCustomerId(customerId, Operation.READ); |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
PageData<EdgeInfo> result; |
|
|
|
if (type != null && type.trim().length() > 0) { |
|
|
|
if (type != null && !type.trim().isEmpty()) { |
|
|
|
result = edgeService.findEdgeInfosByTenantIdAndCustomerIdAndType(tenantId, customerId, type, pageLink); |
|
|
|
} else { |
|
|
|
result = edgeService.findEdgeInfosByTenantIdAndCustomerId(tenantId, customerId, pageLink); |
|
|
|
@ -470,7 +468,7 @@ public class EdgeController extends BaseController { |
|
|
|
@PreAuthorize("hasAuthority('TENANT_ADMIN')") |
|
|
|
@PostMapping(value = "/edge/sync/{edgeId}") |
|
|
|
public DeferredResult<ResponseEntity> syncEdge(@Parameter(description = EDGE_ID_PARAM_DESCRIPTION, required = true) |
|
|
|
@PathVariable("edgeId") String strEdgeId) throws ThingsboardException { |
|
|
|
@PathVariable("edgeId") String strEdgeId) throws ThingsboardException { |
|
|
|
checkParameter("edgeId", strEdgeId); |
|
|
|
final DeferredResult<ResponseEntity> response = new DeferredResult<>(); |
|
|
|
if (isEdgesEnabled() && edgeRpcServiceOpt.isPresent()) { |
|
|
|
|