Browse Source

Fix cmds conversion

pull/9717/head
ViacheslavKlimov 3 years ago
parent
commit
73c7abcf86
  1. 14
      application/src/main/java/org/thingsboard/server/service/ws/notification/cmd/NotificationCmdsWrapper.java

14
application/src/main/java/org/thingsboard/server/service/ws/notification/cmd/NotificationCmdsWrapper.java

@ -41,12 +41,16 @@ public class NotificationCmdsWrapper {
@JsonIgnore
public WsCommandsWrapper toCommonCmdsWrapper() {
WsCommandsWrapper wrapper = new WsCommandsWrapper();
wrapper.setUnreadNotificationsCountSubCmds(List.of(unreadCountSubCmd));
wrapper.setUnreadNotificationsSubCmds(List.of(unreadSubCmd));
wrapper.setMarkNotificationAsReadCmds(List.of(markAsReadCmd));
wrapper.setMarkAllNotificationsAsReadCmds(List.of(markAllAsReadCmd));
wrapper.setNotificationsUnsubCmds(List.of(unsubCmd));
wrapper.setUnreadNotificationsCountSubCmds(toList(unreadCountSubCmd));
wrapper.setUnreadNotificationsSubCmds(toList(unreadSubCmd));
wrapper.setMarkNotificationAsReadCmds(toList(markAsReadCmd));
wrapper.setMarkAllNotificationsAsReadCmds(toList(markAllAsReadCmd));
wrapper.setNotificationsUnsubCmds(toList(unsubCmd));
return wrapper;
}
private <C> List<C> toList(C cmd) {
return cmd != null ? List.of(cmd) : null;
}
}

Loading…
Cancel
Save