package com.qs.mp.framework.redis;

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

/**
 * redis Lock Key管理模版
 *
 * @author duota
 *
 */
public enum RedisLockKey {

    MARKETING_REAL_NUM_LOCK("marketing_real_num_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);
    }

}
