org.zodiac.autoconfigure.cache.http.HttpCacheableAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.cache.http;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.cache.condition.ConditionalOnHttpCacheEnabled;
@SpringBootConfiguration
@ConditionalOnHttpCacheEnabled
@AutoConfigureAfter(value = {CacheAutoConfiguration.class})
@ConditionalOnClass(value = {org.zodiac.cache.http.HttpCacheable.class})
@ConditionalOnBean(value = {org.springframework.cache.CacheManager.class})
public class HttpCacheableAutoConfiguration {
public HttpCacheableAutoConfiguration() {
}
@Bean
@ConfigurationProperties(prefix = "spring.cache.http", ignoreInvalidFields = true)
protected HttpCacheableProperties httpCacheProperties() {
return new HttpCacheableProperties();
}
@Bean
@ConditionalOnMissingBean
protected org.zodiac.cache.http.HttpCacheService httpCacheService(HttpCacheableProperties httpCacheProperties, org.springframework.cache.CacheManager cacheManager) {
return new org.zodiac.cache.http.HttpCacheService(httpCacheProperties, cacheManager);
}
}