Browse Source

Improve NotificationMsgConstructorImpl

pull/10548/head
Andrii Landiak 3 years ago
parent
commit
fed295017d
  1. 12
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/notification/NotificationMsgConstructorImpl.java

12
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/notification/NotificationMsgConstructorImpl.java

@ -35,9 +35,7 @@ public class NotificationMsgConstructorImpl implements NotificationMsgConstructo
@Override @Override
public NotificationRuleUpdateMsg constructNotificationRuleUpdateMsg(UpdateMsgType msgType, NotificationRule notificationRule) { public NotificationRuleUpdateMsg constructNotificationRuleUpdateMsg(UpdateMsgType msgType, NotificationRule notificationRule) {
return NotificationRuleUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationRule)) return NotificationRuleUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationRule)).build();
.setIdMSB(notificationRule.getId().getId().getMostSignificantBits())
.setIdLSB(notificationRule.getId().getId().getLeastSignificantBits()).build();
} }
@Override @Override
@ -50,9 +48,7 @@ public class NotificationMsgConstructorImpl implements NotificationMsgConstructo
@Override @Override
public NotificationTargetUpdateMsg constructNotificationTargetUpdateMsg(UpdateMsgType msgType, NotificationTarget notificationTarget) { public NotificationTargetUpdateMsg constructNotificationTargetUpdateMsg(UpdateMsgType msgType, NotificationTarget notificationTarget) {
return NotificationTargetUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationTarget)) return NotificationTargetUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationTarget)).build();
.setIdMSB(notificationTarget.getId().getId().getMostSignificantBits())
.setIdLSB(notificationTarget.getId().getId().getLeastSignificantBits()).build();
} }
@Override @Override
@ -65,9 +61,7 @@ public class NotificationMsgConstructorImpl implements NotificationMsgConstructo
@Override @Override
public NotificationTemplateUpdateMsg constructNotificationTemplateUpdateMsg(UpdateMsgType msgType, NotificationTemplate notificationTemplate) { public NotificationTemplateUpdateMsg constructNotificationTemplateUpdateMsg(UpdateMsgType msgType, NotificationTemplate notificationTemplate) {
return NotificationTemplateUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationTemplate)) return NotificationTemplateUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(notificationTemplate)).build();
.setIdMSB(notificationTemplate.getId().getId().getMostSignificantBits())
.setIdLSB(notificationTemplate.getId().getId().getLeastSignificantBits()).build();
} }
@Override @Override

Loading…
Cancel
Save