All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.twelvet.idempotent.IdempotentAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
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