mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
chore: 移除 lombok 依赖
再度精简依赖
This commit is contained in:
@@ -20,14 +20,14 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.codec.JsonJacksonCodec;
|
||||
import org.redisson.config.ClusterServersConfig;
|
||||
import org.redisson.config.Config;
|
||||
import org.redisson.config.SentinelServersConfig;
|
||||
import org.redisson.config.SingleServerConfig;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
|
||||
@@ -45,17 +45,25 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "spring.data.redisson", name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(RedissonProperties.class)
|
||||
public class RedissonAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RedissonAutoConfiguration.class);
|
||||
|
||||
private final RedissonProperties properties;
|
||||
private final RedisProperties redisProperties;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public RedissonAutoConfiguration(RedissonProperties properties,
|
||||
RedisProperties redisProperties,
|
||||
ObjectMapper objectMapper) {
|
||||
this.properties = properties;
|
||||
this.redisProperties = redisProperties;
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedissonAutoConfigurationCustomizer redissonAutoConfigurationCustomizer() {
|
||||
return config -> {
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.cache.redisson.autoconfigure;
|
||||
|
||||
import lombok.Data;
|
||||
import org.redisson.config.ClusterServersConfig;
|
||||
import org.redisson.config.SentinelServersConfig;
|
||||
import org.redisson.config.SingleServerConfig;
|
||||
@@ -29,7 +28,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "spring.data.redisson")
|
||||
public class RedissonProperties {
|
||||
|
||||
@@ -77,4 +75,49 @@ public class RedissonProperties {
|
||||
*/
|
||||
SENTINEL
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(Mode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public SingleServerConfig getSingleServerConfig() {
|
||||
return singleServerConfig;
|
||||
}
|
||||
|
||||
public void setSingleServerConfig(SingleServerConfig singleServerConfig) {
|
||||
this.singleServerConfig = singleServerConfig;
|
||||
}
|
||||
|
||||
public ClusterServersConfig getClusterServersConfig() {
|
||||
return clusterServersConfig;
|
||||
}
|
||||
|
||||
public void setClusterServersConfig(ClusterServersConfig clusterServersConfig) {
|
||||
this.clusterServersConfig = clusterServersConfig;
|
||||
}
|
||||
|
||||
public SentinelServersConfig getSentinelServersConfig() {
|
||||
return sentinelServersConfig;
|
||||
}
|
||||
|
||||
public void setSentinelServersConfig(SentinelServersConfig sentinelServersConfig) {
|
||||
this.sentinelServersConfig = sentinelServersConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RedissonProperties{" + "enabled=" + enabled + ", mode=" + mode + ", singleServerConfig=" + singleServerConfig + ", clusterServersConfig=" + clusterServersConfig + ", sentinelServersConfig=" + sentinelServersConfig + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.cache.redisson.util;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import lombok.Data;
|
||||
import org.redisson.api.*;
|
||||
import org.redisson.config.Config;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
@@ -32,7 +31,6 @@ import java.util.stream.Stream;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class RedisUtils {
|
||||
|
||||
private static final RedissonClient CLIENT = SpringUtil.getBean(RedissonClient.class);
|
||||
@@ -180,4 +178,5 @@ public class RedisUtils {
|
||||
}
|
||||
return config.useSingleServer().getNameMapper();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user