package com.red.circle.other.infra.database.cache.key;

import com.red.circle.component.redis.RedisKeys;

/**
 * 火箭系统Redis Key枚举
 *
 * @author system
 * @date 2025-01-15
 */
public enum RocketKeys implements RedisKeys {

    /**
     * 火箭状态缓存
     * KEY: ROCKET:STATUS:{roomId}
     * VALUE: JSON(RocketStatusCO)
     * TTL: 24h
     */
    STATUS,

    /**
     * 火箭能量进度缓存
     * KEY: ROCKET:ENERGY:{roomId}
     * VALUE: String(currentEnergy/maxEnergy)
     * TTL: 24h
     */
    ENERGY,

    /**
     * 火箭分布式锁
     * KEY: ROCKET:LOCK:{roomId}
     * VALUE: timestamp
     * TTL: 5s
     */
    LOCK,

    /**
     * 火箭奖励已领取集合
     * KEY: ROCKET:CLAIMED:{rocketHistoryId}
     * VALUE: Set(userId)
     * TTL: 2min
     */
    CLAIMED,

    LAUNCH,

    /**
     * 火箭配置缓存
     * KEY: ROCKET:CONFIG:{level}
     * VALUE: JSON(RocketConfigCO)
     * TTL: 1h
     */
    CONFIG;

    @Override
    public String businessPrefix() {
        return "ROCKET";
    }

    @Override
    public String businessKey() {
        return this.name();
    }
}
