2024-04-10 07:43:38 +01:00
|
|
|
package cc.fascinated.model.cache;
|
|
|
|
|
2024-04-13 18:02:46 +01:00
|
|
|
import cc.fascinated.common.CacheInformation;
|
2024-04-13 17:30:08 +01:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
2024-04-13 17:21:49 +01:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.ToString;
|
2024-04-10 07:43:38 +01:00
|
|
|
import org.springframework.data.annotation.Id;
|
|
|
|
import org.springframework.data.redis.core.RedisHash;
|
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Braydon
|
|
|
|
*/
|
|
|
|
@Getter
|
|
|
|
@ToString
|
2024-04-13 14:06:48 +01:00
|
|
|
@RedisHash(value = "playerName", timeToLive = 60L * 60L * 6) // 6 hours (in seconds)
|
2024-04-13 18:02:46 +01:00
|
|
|
public class CachedPlayerName extends CachedResponse {
|
2024-04-13 17:29:32 +01:00
|
|
|
/**
|
|
|
|
* The id of the player.
|
|
|
|
*/
|
2024-04-13 17:30:08 +01:00
|
|
|
@JsonIgnore
|
2024-04-13 17:29:32 +01:00
|
|
|
@Id private final String id;
|
|
|
|
|
2024-04-10 07:43:38 +01:00
|
|
|
/**
|
|
|
|
* The username of the player.
|
|
|
|
*/
|
2024-04-13 17:29:32 +01:00
|
|
|
private final String username;
|
2024-04-10 07:43:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The unique id of the player.
|
|
|
|
*/
|
2024-04-13 17:21:33 +01:00
|
|
|
private final UUID uniqueId;
|
|
|
|
|
2024-04-13 17:29:32 +01:00
|
|
|
public CachedPlayerName(String id, String username, UUID uniqueId) {
|
2024-04-13 17:21:33 +01:00
|
|
|
super(CacheInformation.defaultCache());
|
2024-04-13 17:29:32 +01:00
|
|
|
this.id = id;
|
2024-04-13 17:21:33 +01:00
|
|
|
this.username = username;
|
|
|
|
this.uniqueId = uniqueId;
|
|
|
|
}
|
2024-04-10 07:43:38 +01:00
|
|
|
}
|