dev use authtoken
Test Workflow / test (push) Successful in 5s

This commit is contained in:
vladp
2026-02-24 18:35:35 +07:00
parent ba6464147a
commit 87b97c39ea
4 changed files with 55 additions and 1 deletions
@@ -8,6 +8,7 @@ import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
import java.util.concurrent.atomic.AtomicInteger;
@Data
@Builder
@@ -17,6 +18,9 @@ import java.time.LocalDateTime;
@Table(name = "file_entities")
@EntityListeners(AuditingEntityListener.class)
public class FileEntity {
private static AtomicInteger supportIdCounter = new AtomicInteger(0);
@Id
@GeneratedValue(strategy = GenerationType.UUID)
private String id;
@@ -83,6 +87,10 @@ public class FileEntity {
@PrePersist
public void prePersist() {
if (this.supportId == null) {
this.supportId = supportIdCounter.incrementAndGet();
}
if (this.status == null) {
this.status = FileStatus.ACTIVE;
}
@@ -101,4 +109,8 @@ public class FileEntity {
public void preUpdate() {
this.updatedAt = LocalDateTime.now();
}
public static void initializeCounter(int maxId) {
supportIdCounter = new AtomicInteger(maxId);
}
}