mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-07-17 10:06:12 +00:00
update 优化 自动装配警告问题
This commit is contained in:
+4
@@ -4,14 +4,17 @@ import cn.hutool.http.HttpStatus;
|
||||
import com.baomidou.lock.LockFailureStrategy;
|
||||
import com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Role;
|
||||
|
||||
/**
|
||||
* Lock4j 配置
|
||||
*
|
||||
* @author AprilWind
|
||||
*/
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
@AutoConfiguration(before = LockAutoConfiguration.class)
|
||||
public class Lock4jConfig {
|
||||
|
||||
@@ -19,6 +22,7 @@ public class Lock4jConfig {
|
||||
* Lock4j 获取锁失败策略。
|
||||
*/
|
||||
@Bean
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public LockFailureStrategy defaultLockFailureStrategy() {
|
||||
return (key, method, arguments) -> {
|
||||
throw new ServiceException("业务处理中,请稍后再试...", HttpStatus.HTTP_UNAVAILABLE);
|
||||
|
||||
Reference in New Issue
Block a user