Files
Backend/src/main/java/cc/fascinated/model/cache/CachedPlayer.java

38 lines
867 B
Java
Raw Normal View History

2024-04-10 07:43:38 +01:00
package cc.fascinated.model.cache;
import cc.fascinated.model.player.Player;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
2024-04-10 07:43:38 +01:00
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
2024-04-10 07:43:38 +01:00
import org.springframework.data.redis.core.RedisHash;
import java.io.Serializable;
import java.util.UUID;
/**
* A cacheable {@link Player}.
*
* @author Braydon
*/
@Setter @Getter
@AllArgsConstructor
2024-04-10 07:43:38 +01:00
@RedisHash(value = "player", timeToLive = 60L * 60L) // 1 hour (in seconds)
public final class CachedPlayer implements Serializable {
2024-04-10 07:43:38 +01:00
/**
* The unique id of the player.
2024-04-10 07:43:38 +01:00
*/
@JsonIgnore
@Id private UUID uniqueId;
2024-04-10 07:43:38 +01:00
/**
* The player to cache.
*/
private Player player;
/**
* The cache information about the request.
*/
private CacheInformation cache;
2024-04-10 07:43:38 +01:00
}