Commit 6a237b847cfe934ad42e76b7000123359b7925ea
1 parent
9dc88bcb
Add customerId field to alarm data query api
Showing
2 changed files
with
3 additions
and
0 deletions
... | ... | @@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.alarm.Alarm; |
24 | 24 | import org.thingsboard.server.common.data.alarm.AlarmSeverity; |
25 | 25 | import org.thingsboard.server.common.data.alarm.AlarmStatus; |
26 | 26 | import org.thingsboard.server.common.data.id.AlarmId; |
27 | +import org.thingsboard.server.common.data.id.CustomerId; | |
27 | 28 | import org.thingsboard.server.common.data.id.EntityId; |
28 | 29 | import org.thingsboard.server.common.data.id.EntityIdFactory; |
29 | 30 | import org.thingsboard.server.common.data.id.TenantId; |
... | ... | @@ -86,6 +87,7 @@ public class AlarmDataAdapter { |
86 | 87 | alarm.setSeverity(AlarmSeverity.valueOf(row.get(ModelConstants.ALARM_SEVERITY_PROPERTY).toString())); |
87 | 88 | alarm.setStatus(AlarmStatus.valueOf(row.get(ModelConstants.ALARM_STATUS_PROPERTY).toString())); |
88 | 89 | alarm.setTenantId(new TenantId((UUID) row.get(ModelConstants.TENANT_ID_PROPERTY))); |
90 | + alarm.setCustomerId(new CustomerId((UUID) row.get(ModelConstants.CUSTOMER_ID_PROPERTY))); | |
89 | 91 | if (row.get(ModelConstants.ALARM_PROPAGATE_RELATION_TYPES) != null) { |
90 | 92 | String propagateRelationTypes = row.get(ModelConstants.ALARM_PROPAGATE_RELATION_TYPES).toString(); |
91 | 93 | if (!StringUtils.isEmpty(propagateRelationTypes)) { | ... | ... |
... | ... | @@ -101,6 +101,7 @@ public class DefaultAlarmQueryRepository implements AlarmQueryRepository { |
101 | 101 | " a.start_ts as start_ts," + |
102 | 102 | " a.status as status, " + |
103 | 103 | " a.tenant_id as tenant_id, " + |
104 | + " a.customer_id as customer_id, " + | |
104 | 105 | " a.propagate_relation_types as propagate_relation_types, " + |
105 | 106 | " a.type as type," + SELECT_ORIGINATOR_NAME + ", "; |
106 | 107 | ... | ... |