package com.qmth.exam.reserve.cache;

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

    int CACHE_TIME_OUT_1 = 1;

    int CACHE_TIME_OUT_10 = 10;

    int CACHE_TIME_OUT_60 = 60;

    /**
     * 某个分类缓存
     * $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";

    /**
     * 预约队列业务流水号缓存
     * $queue:apply_biz_id
     */
    String QUEUE_APPLY_BIZ_ID = "$queue:apply_biz_id";

    /**
     * 预约任务 - 某考点某时段的“剩余可约数量”的缓存
     * $cache:apply_available_count:{examSiteId}_{timePeriodId}
     */
    String CACHE_APPLY_AVAILABLE_COUNT = "$cache:apply_available_count:%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";

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

    /**
     * 某考点相关的剩余可约数量缓存 操作锁
     * $lock:exam_site_capacity:{examSiteId}
     */
    String LOCK_EXAM_SITE_CAPACITY = "exam_site_capacity:%s";

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

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

}
