Added default dashboard id to asset profile

This commit is contained in:
Volodymyr Babak 2022-10-13 10:46:28 +03:00
parent cc4029120a
commit ef91b66b6a
2 changed files with 8 additions and 4 deletions

View File

@ -16,13 +16,11 @@
package org.thingsboard.server.service.edge.rpc.constructor;
import com.google.protobuf.ByteString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.id.AssetProfileId;
import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.DataDecodingEncodingService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import java.nio.charset.StandardCharsets;
@ -38,6 +36,10 @@ public class AssetProfileMsgConstructor {
.setIdLSB(assetProfile.getId().getId().getLeastSignificantBits())
.setName(assetProfile.getName())
.setDefault(assetProfile.isDefault());
if (assetProfile.getDefaultDashboardId() != null) {
builder.setDefaultDashboardIdMSB(assetProfile.getDefaultDashboardId().getId().getMostSignificantBits())
.setDefaultDashboardIdLSB(assetProfile.getDefaultDashboardId().getId().getLeastSignificantBits());
}
if (assetProfile.getDefaultQueueName() != null) {
builder.setDefaultQueueName(assetProfile.getDefaultQueueName());
}

View File

@ -233,8 +233,10 @@ message AssetProfileUpdateMsg {
bool default = 6;
int64 defaultRuleChainIdMSB = 7;
int64 defaultRuleChainIdLSB = 8;
optional string defaultQueueName = 9;
optional bytes image = 10;
int64 defaultDashboardIdMSB = 9;
int64 defaultDashboardIdLSB = 10;
optional string defaultQueueName = 11;
optional bytes image = 12;
}
message DeviceCredentialsUpdateMsg {