refactoring
This commit is contained in:
parent
2253933250
commit
0a6d227364
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.thingsboard.server.dao.alarm;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.thingsboard.server.common.data.alarm.Alarm;
|
||||
import org.thingsboard.server.common.data.alarm.AlarmSeverity;
|
||||
@ -24,6 +25,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class AlarmOperationResult {
|
||||
private final Alarm alarm;
|
||||
private final boolean successful;
|
||||
@ -38,12 +40,4 @@ public class AlarmOperationResult {
|
||||
public AlarmOperationResult(Alarm alarm, boolean successful, List<EntityId> propagatedEntitiesList) {
|
||||
this(alarm, successful, false, null, propagatedEntitiesList);
|
||||
}
|
||||
|
||||
public AlarmOperationResult(Alarm alarm, boolean successful, boolean created, AlarmSeverity oldSeverity, List<EntityId> propagatedEntitiesList) {
|
||||
this.alarm = alarm;
|
||||
this.successful = successful;
|
||||
this.created = created;
|
||||
this.oldSeverity = oldSeverity;
|
||||
this.propagatedEntitiesList = propagatedEntitiesList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,9 +107,8 @@ public class BaseAlarmCommentService extends AbstractEntityService implements Al
|
||||
if (existing != null) {
|
||||
if (newAlarmComment.getComment() != null) {
|
||||
JsonNode comment = newAlarmComment.getComment();
|
||||
UUID uuid = Uuids.timeBased();
|
||||
((ObjectNode) comment).put("edited", "true");
|
||||
((ObjectNode) comment).put("editedOn", Uuids.unixTimestamp(uuid));
|
||||
((ObjectNode) comment).put("editedOn", System.currentTimeMillis());
|
||||
existing.setComment(comment);
|
||||
}
|
||||
return alarmCommentDao.save(tenantId, existing);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user