Edge dashboard msg - added isMobileHide and mobileOrder

This commit is contained in:
Volodymyr Babak 2023-08-29 16:45:18 +03:00
parent 87ab3e255e
commit bc7ef38ee6
3 changed files with 10 additions and 1 deletions

View File

@ -33,13 +33,17 @@ public class DashboardMsgConstructor {
.setIdMSB(dashboard.getId().getId().getMostSignificantBits()) .setIdMSB(dashboard.getId().getId().getMostSignificantBits())
.setIdLSB(dashboard.getId().getId().getLeastSignificantBits()) .setIdLSB(dashboard.getId().getId().getLeastSignificantBits())
.setTitle(dashboard.getTitle()) .setTitle(dashboard.getTitle())
.setConfiguration(JacksonUtil.toString(dashboard.getConfiguration())); .setConfiguration(JacksonUtil.toString(dashboard.getConfiguration()))
.setMobileHide(dashboard.isMobileHide());
if (dashboard.getAssignedCustomers() != null) { if (dashboard.getAssignedCustomers() != null) {
builder.setAssignedCustomers(JacksonUtil.toString(dashboard.getAssignedCustomers())); builder.setAssignedCustomers(JacksonUtil.toString(dashboard.getAssignedCustomers()));
} }
if (dashboard.getImage() != null) { if (dashboard.getImage() != null) {
builder.setImage(dashboard.getImage()); builder.setImage(dashboard.getImage());
} }
if (dashboard.getMobileOrder() != null) {
builder.setMobileOrder(dashboard.getMobileOrder());
}
return builder.build(); return builder.build();
} }

View File

@ -52,6 +52,9 @@ public abstract class BaseDashboardProcessor extends BaseEdgeProcessor {
dashboard.setAssignedCustomers(assignedCustomers); dashboard.setAssignedCustomers(assignedCustomers);
} }
dashboard.setMobileOrder(dashboardUpdateMsg.hasMobileOrder() ? dashboardUpdateMsg.getMobileOrder() : null);
dashboard.setMobileHide(dashboardUpdateMsg.getMobileHide());
dashboardValidator.validate(dashboard, Dashboard::getTenantId); dashboardValidator.validate(dashboard, Dashboard::getTenantId);
if (created) { if (created) {
dashboard.setId(dashboardId); dashboard.setId(dashboardId);

View File

@ -188,6 +188,8 @@ message DashboardUpdateMsg {
string configuration = 7; string configuration = 7;
optional string assignedCustomers = 8; optional string assignedCustomers = 8;
optional string image = 9; optional string image = 9;
optional int32 mobileOrder = 10;
bool mobileHide = 11;
} }
message DeviceUpdateMsg { message DeviceUpdateMsg {