dev add updateTime
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-04-06 12:37:49 +07:00
parent 48a83591da
commit 5f063354e6
7 changed files with 51 additions and 10 deletions
@@ -26,7 +26,7 @@ public class Notification {
@Column(name = "created_at", updatable = false)
@CreatedDate
private LocalDateTime createdAt;
private LocalDateTime createdAt = LocalDateTime.now();
@LastModifiedDate
@Column(name = "updated_at")
@@ -46,4 +46,13 @@ public class Notification {
@JoinColumn(name = "user_id")
@JsonIgnore
private User user;
@PrePersist
public void prePersist() {
if (this.createdAt == null) {
this.createdAt = LocalDateTime.now();
}
this.updatedAt = LocalDateTime.now();
}
}