package org.dromara.facility.constant;

/**
 * @author lcj
 * @date 2025/5/27 18:27
 */
public interface FacRedisKeyConstant {

    String FAC_REDIS_PREFIX = "fac:";

    String FAC_IN_OPERATION_REDIS_KEY_PREFIX = FAC_REDIS_PREFIX + "inOperation:";

    /**
     * 批量上传桩点、支架、立柱 Redis 缓存 key
     *
     * @param sessionId 唯一标识
     * @param batchNum  第几批数据
     * @return Redis 缓存 key
     */
    static String getBatchUploadPartsRedisKey(String sessionId, int batchNum) {
        return String.format("%s%s:%s:%s", FAC_REDIS_PREFIX, "panel:parts", sessionId, batchNum);
    }

    /**
     * 当前项目是否正在操作 Redis 缓存 key
     *
     * @param projectId 项目 ID
     * @return Redis 缓存 key
     */
    static String getInOperationByProjectRedisKey(Long projectId) {
        return String.format("%s%s:%s", FAC_IN_OPERATION_REDIS_KEY_PREFIX, "project", projectId);
    }

}
