Files
Backend/src/main/java/cc.fascinated/model/cache/CachedMinecraftServer.java
Liam 3a3a2e223f
All checks were successful
ci / deploy (push) Successful in 1m4s
don't return the cache id for servers
2024-04-10 08:21:52 +01:00

34 lines
834 B
Java

package cc.fascinated.model.cache;
import cc.fascinated.model.server.MinecraftServer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import java.io.Serializable;
/**
* @author Braydon
*/
@AllArgsConstructor @Setter @Getter @ToString
@RedisHash(value = "server", timeToLive = 60L) // 1 minute (in seconds)
public final class CachedMinecraftServer implements Serializable {
/**
* The id of this cached server.
*/
@Id @NonNull @JsonIgnore
private final String id;
/**
* The cached server.
*/
@NonNull
private final MinecraftServer value;
/**
* The unix timestamp of when this
* server was cached, -1 if not cached.
*/
private long cached;
}