cn.twelvet.idempotent.IdempotentAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idempotent-spring-boot-starter Show documentation
Show all versions of idempotent-spring-boot-starter Show documentation
Importing and exporting Excel based on easyexcel annotation
package cn.twelvet.idempotent;
import cn.twelvet.idempotent.aspect.IdempotentAspect;
import cn.twelvet.idempotent.expression.ExpressionResolver;
import cn.twelvet.idempotent.expression.KeyResolver;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 幂等 AutoConfiguration
*
* @author twelvet
*
*/
@AutoConfiguration
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(RedisAutoConfiguration.class)
public class IdempotentAutoConfiguration {
/**
* 切面 拦截处理所有 @Idempotent
* @return Aspect
*/
@Bean
public IdempotentAspect idempotentAspect() {
return new IdempotentAspect();
}
/**
* key 解析器
* @return KeyResolver
*/
@Bean
@ConditionalOnMissingBean(KeyResolver.class)
public KeyResolver keyResolver() {
return new ExpressionResolver();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy