Browse Source

fixes in controller

pull/2436/head
Bohdan Smetaniuk 6 years ago
parent
commit
7f848b3242
  1. 2
      application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
  2. 2
      application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
  3. 2
      application/src/main/java/org/thingsboard/server/service/edge/DefaultEdgeNotificationService.java

2
application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java

@ -72,7 +72,7 @@ public class WidgetTypeController extends BaseController {
checkEntity(widgetType.getId(), widgetType, Resource.WIDGET_TYPE); checkEntity(widgetType.getId(), widgetType, Resource.WIDGET_TYPE);
WidgetType savedWidgetType = widgetTypeService.saveWidgetType(widgetType); WidgetType savedWidgetType = widgetTypeService.saveWidgetType(widgetType);
sendNotificationMsgToEdgeService(savedWidgetType.getTenantId(), savedWidgetType.getId(), savedWidgetType.getId() == null ? ActionType.ADDED : ActionType.UPDATED); sendNotificationMsgToEdgeService(getTenantId(), savedWidgetType.getId(), widgetType.getId() == null ? ActionType.ADDED : ActionType.UPDATED);
return checkNotNull(savedWidgetType); return checkNotNull(savedWidgetType);
} catch (Exception e) { } catch (Exception e) {

2
application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java

@ -71,7 +71,7 @@ public class WidgetsBundleController extends BaseController {
checkEntity(widgetsBundle.getId(), widgetsBundle, Resource.WIDGETS_BUNDLE); checkEntity(widgetsBundle.getId(), widgetsBundle, Resource.WIDGETS_BUNDLE);
WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle); WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle);
sendNotificationMsgToEdgeService(savedWidgetsBundle.getTenantId(), savedWidgetsBundle.getId(), savedWidgetsBundle.getId() == null ? ActionType.ADDED : ActionType.UPDATED); sendNotificationMsgToEdgeService(getTenantId(), savedWidgetsBundle.getId(), widgetsBundle.getId() == null ? ActionType.ADDED : ActionType.UPDATED);
return checkNotNull(savedWidgetsBundle); return checkNotNull(savedWidgetsBundle);
} catch (Exception e) { } catch (Exception e) {

2
application/src/main/java/org/thingsboard/server/service/edge/DefaultEdgeNotificationService.java

@ -184,7 +184,7 @@ public class DefaultEdgeNotificationService implements EdgeNotificationService {
EntityId entityId = EntityIdFactory.getByEdgeEventTypeAndUuid(edgeEventType, new UUID(edgeNotificationMsg.getEntityIdMSB(), edgeNotificationMsg.getEntityIdLSB())); EntityId entityId = EntityIdFactory.getByEdgeEventTypeAndUuid(edgeEventType, new UUID(edgeNotificationMsg.getEntityIdMSB(), edgeNotificationMsg.getEntityIdLSB()));
switch (edgeEventActionType) { switch (edgeEventActionType) {
// TODO: voba - ADDED is not required for CE version ? // TODO: voba - ADDED is not required for CE version ?
// case ADDED: case ADDED:
case UPDATED: case UPDATED:
case CREDENTIALS_UPDATED: case CREDENTIALS_UPDATED:
if (edgeEventType.equals(EdgeEventType.WIDGETS_BUNDLE) || edgeEventType.equals(EdgeEventType.WIDGET_TYPE)) { if (edgeEventType.equals(EdgeEventType.WIDGETS_BUNDLE) || edgeEventType.equals(EdgeEventType.WIDGET_TYPE)) {

Loading…
Cancel
Save