package com.willalp.common.lock;

import cn.hutool.json.JSONUtil;
import com.willalp.common.exception.base.BaseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * @Description
 * @Author songyu
 */
public interface FailedHandler {

    Object handler(List<String> keys,Object... args);

}

class  DefaultFailed implements FailedHandler{

    static final Logger log = LoggerFactory.getLogger(DefaultFailed.class);

    @Override
    public Object handler(List<String> keys, Object... args) {
        log.error("锁获取失败[{}]", JSONUtil.toJsonStr(keys));
        throw new BaseException("ERROR_LOCK_0001");
    }
}