Showing
1 changed file
with
7 additions
and
4 deletions
... | ... | @@ -25,10 +25,7 @@ import org.thingsboard.server.common.data.EntityType; |
25 | 25 | import org.thingsboard.server.common.data.audit.ActionStatus; |
26 | 26 | import org.thingsboard.server.common.data.audit.ActionType; |
27 | 27 | import org.thingsboard.server.common.data.audit.AuditLog; |
28 | -import org.thingsboard.server.common.data.id.AuditLogId; | |
29 | -import org.thingsboard.server.common.data.id.CustomerId; | |
30 | -import org.thingsboard.server.common.data.id.EntityIdFactory; | |
31 | -import org.thingsboard.server.common.data.id.TenantId; | |
28 | +import org.thingsboard.server.common.data.id.*; | |
32 | 29 | import org.thingsboard.server.dao.model.BaseEntity; |
33 | 30 | import org.thingsboard.server.dao.model.BaseSqlEntity; |
34 | 31 | import org.thingsboard.server.dao.model.ModelConstants; |
... | ... | @@ -100,6 +97,9 @@ public class AuditLogEntity extends BaseSqlEntity<AuditLog> implements BaseEntit |
100 | 97 | this.entityId = toString(auditLog.getEntityId().getId()); |
101 | 98 | this.entityType = auditLog.getEntityId().getEntityType(); |
102 | 99 | } |
100 | + if (auditLog.getUserId() != null) { | |
101 | + this.userId = toString(auditLog.getUserId().getId()); | |
102 | + } | |
103 | 103 | this.entityName = auditLog.getEntityName(); |
104 | 104 | this.userName = auditLog.getUserName(); |
105 | 105 | this.actionType = auditLog.getActionType(); |
... | ... | @@ -121,6 +121,9 @@ public class AuditLogEntity extends BaseSqlEntity<AuditLog> implements BaseEntit |
121 | 121 | if (entityId != null) { |
122 | 122 | auditLog.setEntityId(EntityIdFactory.getByTypeAndId(entityType.name(), toUUID(entityId).toString())); |
123 | 123 | } |
124 | + if (userId != null) { | |
125 | + auditLog.setUserId(new UserId(toUUID(entityId))); | |
126 | + } | |
124 | 127 | auditLog.setEntityName(this.entityName); |
125 | 128 | auditLog.setUserName(this.userName); |
126 | 129 | auditLog.setActionType(this.actionType); | ... | ... |