package com.yifu.cloud.plus.v1.yifu.common.core.redis.lock4j;

import com.baomidou.lock.LockFailureStrategy;
import com.baomidou.lock.exception.LockFailureException;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * @Author fxj
 * @Date 2023/2/7
 * @Description  lock4j  分布式锁 异常 自定义异常策略
 * @Version 1.0
 */
@Component
public class MyLockFailureStrategy implements LockFailureStrategy {

	@Override
	public void onLockFailure(String key, Method method, Object[] arguments) {
		throw  new LockFailureException("业务执行中，请稍后重试");
	}
}
