package com.qs.mp.framework.redis;

import com.qs.mp.common.utils.MessageHelper;

/**
 * redis Lock Key管理模版
 *
 * @author duota
 *
 */
public enum RedisLockKey {
    CREATED_ONLINE_TICKET_ORDER_KEY("created_online_ticket_order_key_{0}", "线上盲票创建锁"),
    ASYNC_TASK_KEY("async_task_key_{0}", "异步任务key"),

    MARKETING_JOIN_LOCK("marketing_join_lock_{0}", "活动参与锁"),

    MARKETING_LOTTERY_KEY("marketing_lottery_key_{0}","免费抽奖活动开奖"),
    USER_TICKET_CASH_LOCK("user_ticket_cash_lock_{0}", "盲票兑奖锁");

    public String keyTemplate;
    public String desc;

    RedisLockKey(String keyTemplate, String desc) {
        this.keyTemplate = keyTemplate;
        this.desc = desc;
    }

    public static String build(RedisLockKey redisLockKey, Object... param) {
        return MessageHelper.formatMsg(redisLockKey.keyTemplate, param);
    }

}
