Add unique id to TrackProgress

This commit is contained in:
2026-01-08 03:55:12 +05:00
parent aef8980786
commit 5b6862f678

View File

@ -1,5 +1,7 @@
package com.bivashy.backend.composer.dto.importing;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@ -9,20 +11,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
@JsonSubTypes.Type(value = SingleTrackProgress.class, name = "TRACK"),
})
public abstract class BaseTrackProgress {
protected UUID id;
protected long playlistId;
protected long trackSourceId;
protected long userId;
protected long timestamp;
private String type;
private ProgressEntryType type;
public BaseTrackProgress(long playlistId, long trackSourceId, long userId) {
this.id = UUID.randomUUID();
this.playlistId = playlistId;
this.trackSourceId = trackSourceId;
this.userId = userId;
this.timestamp = System.currentTimeMillis();
}
public UUID getId() {
return id;
}
public Long getTimestamp() {
return timestamp;
}
@ -31,7 +39,7 @@ public abstract class BaseTrackProgress {
return userId;
}
public String getType() {
public ProgressEntryType getType() {
return type;
}
@ -44,7 +52,7 @@ public abstract class BaseTrackProgress {
}
protected void setType(ProgressEntryType type) {
this.type = type.name();
this.type = type;
}
}