package com.ruoyi.cai.manager;

import com.ruoyi.cai.constant.RedisConstant;

public class LockManager {

    public static final String LOCK_REGISTER_REDIS = RedisConstant.REDIS_P + "lock:register:%s";
    public static final String LOCK_DEAL_INVITE_REDIS = RedisConstant.REDIS_P + "lock:dealInvite:%s";
    public static final String LOCK_ADD_USER_GREET_REDIS = RedisConstant.REDIS_P + "lock:addUserGreet:%s";
    public static final String LOCK_SEND_GREET_REDIS = RedisConstant.REDIS_P + "lock:sendGreet:%s";

    public static String getRegisterLockKey(String mobile){
        return String.format(LOCK_REGISTER_REDIS,mobile);
    }

    public static String getDealInviteLockKey(Long userId){
        return String.format(LOCK_DEAL_INVITE_REDIS,userId);
    }

    public static String getAddUserGreetLock(Long userId){
        return String.format(LOCK_ADD_USER_GREET_REDIS,userId);
    }

    public static String getSendGreetLock(Long userId){
        return String.format(LOCK_SEND_GREET_REDIS,userId);
    }
}
