package com.qmth.exam.reserve.cache;

/**
 * 缓存相关常量
 */
public interface CacheConstants {

    /**
     * 某个分类缓存
     * $cache:category:{categoryId}
     */
    String CACHE_CATEGORY = "$cache:category:%s";

    /**
     * 某个考点缓存
     * $cache:exam_site:{examSiteId}
     */
    String CACHE_EXAM_SITE = "$cache:exam_site:%s";

    /**
     * 某个学校缓存
     * $cache:org:{orgId}
     */
    String CACHE_ORG = "$cache:org:%s";

    /**
     * 当前默认的学校缓存
     * $cache:current_org
     */
    String CACHE_CURRENT_ORG = "$cache:current_org";

    /**
     * 当前启用的预约任务缓存
     * $cache:current_apply_task:{orgId}
     */
    String CACHE_CURRENT_APPLY_TASK = "$cache:current_apply_task:%s";

    /**
     * 预约任务 - 某考点的“可预约总量”的缓存
     * $cache:apply_total:{examSiteId}
     */
    String CACHE_APPLY_TOTAL = "$cache:apply_total:%s";

    /**
     * 预约任务 - 某考点某时段的“已预约数量”的缓存
     * $cache:apply_finish:{examSiteId}_{timePeriodId}
     */
    String CACHE_APPLY_FINISH = "$cache:apply_finish:%s_%s";

    /**
     * 某考生的“允许预约时段次数”的缓存
     * $cache:student_apply_number:{studentId}
     */
    String CACHE_STUDENT_APPLY_NUMBER = "$cache:student_apply_number:%s";

    /**
     * 某考生的“预约记录”的缓存
     * $cache:student_apply_record:{studentId}
     * hashKey:{examSiteId}_{timePeriodId}
     */
    String CACHE_STUDENT_APPLY_RECORD = "$cache:student_apply_record:%s";

    /**
     * 考生预约记录队列
     * $queue:student_apply_record
     */
    String QUEUE_STUDENT_APPLY_RECORD = "$queue:student_apply_record";

    /**
     * 考生预约记录队列 操作锁
     * $lock:student_apply_record
     */
    String LOCK_STUDENT_APPLY_RECORD = "student_apply_record";

    /**
     * 某考生预约 操作锁
     * $lock:student_apply:{studentId}
     */
    String LOCK_STUDENT_APPLY = "student_apply:%s";

    /**
     * 系统自动为考生预约操作锁
     * $lock:auto_apply
     */
    String LOCK_AUTO_APPLY = "auto_apply";

    /**
     * 自动排考操作锁
     * $lock:arrange_exam:{yyyyMMdd}
     */
    String LOCK_ARRANGE_EXAM = "arrange_exam:%s";

}
