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:
@@ -25,7 +25,8 @@ import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -51,13 +52,13 @@ import java.util.concurrent.TimeUnit;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.SPRINGDOC_SWAGGER_UI, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(SpringDocExtensionProperties.class)
|
||||
@PropertySource(value = "classpath:default-api-doc.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SpringDocAutoConfiguration implements WebMvcConfigurer {
|
||||
private static final Logger log = LoggerFactory.getLogger(SpringDocAutoConfiguration.class);
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.apidoc.autoconfigure;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -28,7 +27,6 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.0.1
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = PropertiesConstants.SPRINGDOC)
|
||||
public class SpringDocExtensionProperties {
|
||||
|
||||
@@ -37,4 +35,17 @@ public class SpringDocExtensionProperties {
|
||||
*/
|
||||
@NestedConfigurationProperty
|
||||
private Components components;
|
||||
|
||||
public Components getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
public void setComponents(Components components) {
|
||||
this.components = components;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpringDocExtensionProperties{" + "components=" + components + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -17,9 +17,10 @@
|
||||
package top.charles7c.continew.starter.auth.justauth.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.zhyd.oauth.cache.AuthStateCache;
|
||||
import org.redisson.client.RedisClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -33,11 +34,12 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration(before = com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration.class)
|
||||
@ConditionalOnProperty(prefix = "justauth", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
public class JustAuthAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(JustAuthAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* 自定义 State 缓存实现
|
||||
*/
|
||||
|
@@ -23,8 +23,8 @@ import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -42,17 +42,20 @@ import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@ComponentScan("top.charles7c.continew.starter.auth.satoken.exception")
|
||||
@EnableConfigurationProperties(SaTokenExtensionProperties.class)
|
||||
@ConditionalOnProperty(prefix = "sa-token.extension", name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@PropertySource(value = "classpath:default-auth-satoken.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SaTokenAutoConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SaTokenAutoConfiguration.class);
|
||||
private final SaTokenExtensionProperties properties;
|
||||
|
||||
public SaTokenAutoConfiguration(SaTokenExtensionProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验
|
||||
|
@@ -18,8 +18,9 @@ package top.charles7c.continew.starter.auth.satoken.autoconfigure;
|
||||
|
||||
import cn.dev33.satoken.dao.SaTokenDao;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.client.RedisClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -34,9 +35,10 @@ import top.charles7c.continew.starter.cache.redisson.autoconfigure.RedissonAutoC
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
abstract class SaTokenDaoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SaTokenDaoConfiguration.class);
|
||||
|
||||
private SaTokenDaoConfiguration() {
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.auth.satoken.autoconfigure;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import top.charles7c.continew.starter.auth.satoken.properties.SaTokenDaoProperties;
|
||||
@@ -29,7 +28,6 @@ import top.charles7c.continew.starter.auth.satoken.properties.SaTokenSecurityPro
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "sa-token.extension")
|
||||
public class SaTokenExtensionProperties {
|
||||
|
||||
@@ -54,4 +52,41 @@ public class SaTokenExtensionProperties {
|
||||
*/
|
||||
@NestedConfigurationProperty
|
||||
private SaTokenSecurityProperties security;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Class<? extends StpInterface> getPermissionImpl() {
|
||||
return permissionImpl;
|
||||
}
|
||||
|
||||
public void setPermissionImpl(Class<? extends StpInterface> permissionImpl) {
|
||||
this.permissionImpl = permissionImpl;
|
||||
}
|
||||
|
||||
public SaTokenDaoProperties getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
public void setDao(SaTokenDaoProperties dao) {
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
public SaTokenSecurityProperties getSecurity() {
|
||||
return security;
|
||||
}
|
||||
|
||||
public void setSecurity(SaTokenSecurityProperties security) {
|
||||
this.security = security;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SaTokenExtensionProperties{" + "enabled=" + enabled + ", permissionImpl=" + permissionImpl + ", dao=" + dao + ", security=" + security + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,8 @@ import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.exception.NotPermissionException;
|
||||
import cn.dev33.satoken.exception.NotRoleException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
@@ -32,10 +33,11 @@ import top.charles7c.continew.starter.web.model.R;
|
||||
* @author Charles7c
|
||||
* @since 1.2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
public class GlobalSaTokenExceptionHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalSaTokenExceptionHandler.class);
|
||||
|
||||
/**
|
||||
* 认证异常-登录认证
|
||||
*/
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.auth.satoken.properties;
|
||||
|
||||
import cn.dev33.satoken.dao.SaTokenDao;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.auth.satoken.enums.SaTokenDaoType;
|
||||
|
||||
/**
|
||||
@@ -26,7 +25,6 @@ import top.charles7c.continew.starter.auth.satoken.enums.SaTokenDaoType;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class SaTokenDaoProperties {
|
||||
|
||||
/**
|
||||
@@ -38,4 +36,25 @@ public class SaTokenDaoProperties {
|
||||
* 自定义持久层实现类(当 type 为 CUSTOM 时必填)
|
||||
*/
|
||||
private Class<? extends SaTokenDao> impl;
|
||||
|
||||
public SaTokenDaoType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(SaTokenDaoType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Class<? extends SaTokenDao> getImpl() {
|
||||
return impl;
|
||||
}
|
||||
|
||||
public void setImpl(Class<? extends SaTokenDao> impl) {
|
||||
this.impl = impl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SaTokenDaoProperties{" + "type=" + type + ", impl=" + impl + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,24 @@
|
||||
|
||||
package top.charles7c.continew.starter.auth.satoken.properties;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* SaToken 安全配置属性
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class SaTokenSecurityProperties {
|
||||
|
||||
/**
|
||||
* 排除(放行)路径配置
|
||||
*/
|
||||
private String[] excludes = new String[0];
|
||||
|
||||
public String[] getExcludes() {
|
||||
return excludes;
|
||||
}
|
||||
|
||||
public void setExcludes(String[] excludes) {
|
||||
this.excludes = excludes;
|
||||
}
|
||||
}
|
@@ -17,8 +17,8 @@
|
||||
package top.charles7c.continew.starter.cache.jetcache.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
@@ -30,15 +30,16 @@ import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
|
||||
* @author Charles7c
|
||||
* @since 1.2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@Import(com.alicp.jetcache.autoconfigure.JetCacheAutoConfiguration.class)
|
||||
@PropertySource(value = "classpath:default-cache-jetcache.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class JetCacheAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(JetCacheAutoConfiguration.class);
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'JetCache' completed initialization.");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.cache.CacheProperties;
|
||||
import org.springframework.cache.annotation.CachingConfigurer;
|
||||
@@ -45,14 +45,18 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@PropertySource(value = "classpath:default-cache-springcache.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SpringCacheAutoConfiguration implements CachingConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SpringCacheAutoConfiguration.class);
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public SpringCacheAutoConfiguration(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redis 缓存配置
|
||||
*
|
||||
|
@@ -24,8 +24,8 @@ import com.anji.captcha.service.CaptchaService;
|
||||
import com.anji.captcha.service.impl.CaptchaServiceFactory;
|
||||
import com.anji.captcha.util.ImageUtils;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -48,15 +48,18 @@ import java.util.Properties;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_BEHAVIOR, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(BehaviorCaptchaProperties.class)
|
||||
public class BehaviorCaptchaAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BehaviorCaptchaAutoConfiguration.class);
|
||||
private final BehaviorCaptchaProperties properties;
|
||||
|
||||
public BehaviorCaptchaAutoConfiguration(BehaviorCaptchaProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义缓存实现配置
|
||||
*/
|
||||
|
@@ -21,8 +21,9 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.anji.captcha.service.CaptchaCacheService;
|
||||
import com.anji.captcha.service.impl.CaptchaServiceFactory;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.client.RedisClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -39,9 +40,10 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
abstract class BehaviorCaptchaCacheConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BehaviorCaptchaCacheConfiguration.class);
|
||||
|
||||
private BehaviorCaptchaCacheConfiguration() {
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,6 @@ package top.charles7c.continew.starter.captcha.behavior.autoconfigure;
|
||||
|
||||
import com.anji.captcha.model.common.CaptchaTypeEnum;
|
||||
import com.anji.captcha.service.CaptchaCacheService;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.captcha.behavior.enums.StorageType;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -31,7 +30,6 @@ import java.awt.*;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.CAPTCHA_BEHAVIOR)
|
||||
public class BehaviorCaptchaProperties {
|
||||
|
||||
@@ -149,4 +147,193 @@ public class BehaviorCaptchaProperties {
|
||||
* 点选字体大小(默认:25)
|
||||
*/
|
||||
private int fontSize = 25;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Boolean getEnableAes() {
|
||||
return enableAes;
|
||||
}
|
||||
|
||||
public void setEnableAes(Boolean enableAes) {
|
||||
this.enableAes = enableAes;
|
||||
}
|
||||
|
||||
public CaptchaTypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(CaptchaTypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public StorageType getCacheType() {
|
||||
return cacheType;
|
||||
}
|
||||
|
||||
public void setCacheType(StorageType cacheType) {
|
||||
this.cacheType = cacheType;
|
||||
}
|
||||
|
||||
public Class<? extends CaptchaCacheService> getCacheImpl() {
|
||||
return cacheImpl;
|
||||
}
|
||||
|
||||
public void setCacheImpl(Class<? extends CaptchaCacheService> cacheImpl) {
|
||||
this.cacheImpl = cacheImpl;
|
||||
}
|
||||
|
||||
public String getJigsawBaseMapPath() {
|
||||
return jigsawBaseMapPath;
|
||||
}
|
||||
|
||||
public void setJigsawBaseMapPath(String jigsawBaseMapPath) {
|
||||
this.jigsawBaseMapPath = jigsawBaseMapPath;
|
||||
}
|
||||
|
||||
public String getSlipOffset() {
|
||||
return slipOffset;
|
||||
}
|
||||
|
||||
public void setSlipOffset(String slipOffset) {
|
||||
this.slipOffset = slipOffset;
|
||||
}
|
||||
|
||||
public String getPicClickBaseMapPath() {
|
||||
return picClickBaseMapPath;
|
||||
}
|
||||
|
||||
public void setPicClickBaseMapPath(String picClickBaseMapPath) {
|
||||
this.picClickBaseMapPath = picClickBaseMapPath;
|
||||
}
|
||||
|
||||
public String getFontType() {
|
||||
return fontType;
|
||||
}
|
||||
|
||||
public void setFontType(String fontType) {
|
||||
this.fontType = fontType;
|
||||
}
|
||||
|
||||
public Integer getHistoryDataClearEnable() {
|
||||
return historyDataClearEnable;
|
||||
}
|
||||
|
||||
public void setHistoryDataClearEnable(Integer historyDataClearEnable) {
|
||||
this.historyDataClearEnable = historyDataClearEnable;
|
||||
}
|
||||
|
||||
public Integer getReqFrequencyLimitEnable() {
|
||||
return reqFrequencyLimitEnable;
|
||||
}
|
||||
|
||||
public void setReqFrequencyLimitEnable(Integer reqFrequencyLimitEnable) {
|
||||
this.reqFrequencyLimitEnable = reqFrequencyLimitEnable;
|
||||
}
|
||||
|
||||
public int getReqGetLockLimit() {
|
||||
return reqGetLockLimit;
|
||||
}
|
||||
|
||||
public void setReqGetLockLimit(int reqGetLockLimit) {
|
||||
this.reqGetLockLimit = reqGetLockLimit;
|
||||
}
|
||||
|
||||
public int getReqGetLockSeconds() {
|
||||
return reqGetLockSeconds;
|
||||
}
|
||||
|
||||
public void setReqGetLockSeconds(int reqGetLockSeconds) {
|
||||
this.reqGetLockSeconds = reqGetLockSeconds;
|
||||
}
|
||||
|
||||
public int getReqGetMinuteLimit() {
|
||||
return reqGetMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqGetMinuteLimit(int reqGetMinuteLimit) {
|
||||
this.reqGetMinuteLimit = reqGetMinuteLimit;
|
||||
}
|
||||
|
||||
public int getReqCheckMinuteLimit() {
|
||||
return reqCheckMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqCheckMinuteLimit(int reqCheckMinuteLimit) {
|
||||
this.reqCheckMinuteLimit = reqCheckMinuteLimit;
|
||||
}
|
||||
|
||||
public int getReqVerifyMinuteLimit() {
|
||||
return reqVerifyMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqVerifyMinuteLimit(int reqVerifyMinuteLimit) {
|
||||
this.reqVerifyMinuteLimit = reqVerifyMinuteLimit;
|
||||
}
|
||||
|
||||
public String getCacheNumber() {
|
||||
return cacheNumber;
|
||||
}
|
||||
|
||||
public void setCacheNumber(String cacheNumber) {
|
||||
this.cacheNumber = cacheNumber;
|
||||
}
|
||||
|
||||
public String getTimingClear() {
|
||||
return timingClear;
|
||||
}
|
||||
|
||||
public void setTimingClear(String timingClear) {
|
||||
this.timingClear = timingClear;
|
||||
}
|
||||
|
||||
public String getWaterMark() {
|
||||
return waterMark;
|
||||
}
|
||||
|
||||
public void setWaterMark(String waterMark) {
|
||||
this.waterMark = waterMark;
|
||||
}
|
||||
|
||||
public String getWaterFont() {
|
||||
return waterFont;
|
||||
}
|
||||
|
||||
public void setWaterFont(String waterFont) {
|
||||
this.waterFont = waterFont;
|
||||
}
|
||||
|
||||
public String getInterferenceOptions() {
|
||||
return interferenceOptions;
|
||||
}
|
||||
|
||||
public void setInterferenceOptions(String interferenceOptions) {
|
||||
this.interferenceOptions = interferenceOptions;
|
||||
}
|
||||
|
||||
public int getFontStyle() {
|
||||
return fontStyle;
|
||||
}
|
||||
|
||||
public void setFontStyle(int fontStyle) {
|
||||
this.fontStyle = fontStyle;
|
||||
}
|
||||
|
||||
public int getFontSize() {
|
||||
return fontSize;
|
||||
}
|
||||
|
||||
public void setFontSize(int fontSize) {
|
||||
this.fontSize = fontSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BehaviorCaptchaProperties{" + "enabled=" + enabled + ", enableAes=" + enableAes + ", type=" + type + ", cacheType=" + cacheType + ", cacheImpl=" + cacheImpl + ", jigsawBaseMapPath='" + jigsawBaseMapPath + '\'' + ", slipOffset='" + slipOffset + '\'' + ", picClickBaseMapPath='" + picClickBaseMapPath + '\'' + ", fontType='" + fontType + '\'' + ", historyDataClearEnable=" + historyDataClearEnable + ", reqFrequencyLimitEnable=" + reqFrequencyLimitEnable + ", reqGetLockLimit=" + reqGetLockLimit + ", reqGetLockSeconds=" + reqGetLockSeconds + ", reqGetMinuteLimit=" + reqGetMinuteLimit + ", reqCheckMinuteLimit=" + reqCheckMinuteLimit + ", reqVerifyMinuteLimit=" + reqVerifyMinuteLimit + ", cacheNumber='" + cacheNumber + '\'' + ", timingClear='" + timingClear + '\'' + ", waterMark='" + waterMark + '\'' + ", waterFont='" + waterFont + '\'' + ", interferenceOptions='" + interferenceOptions + '\'' + ", fontStyle=" + fontStyle + ", fontSize=" + fontSize + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -16,15 +16,12 @@
|
||||
|
||||
package top.charles7c.continew.starter.captcha.behavior.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 缓存类型枚举
|
||||
*
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Getter
|
||||
public enum StorageType {
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,8 @@
|
||||
package top.charles7c.continew.starter.captcha.graphic.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.context.properties.EnableConfigurationProperties;
|
||||
@@ -29,12 +30,13 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(GraphicCaptchaProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
public class GraphicCaptchaAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GraphicCaptchaAutoConfiguration.class);
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'Graphic Captcha' completed initialization.");
|
||||
|
@@ -19,7 +19,6 @@ package top.charles7c.continew.starter.captcha.graphic.autoconfigure;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.wf.captcha.base.Captcha;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.captcha.graphic.enums.GraphicCaptchaType;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -32,7 +31,6 @@ import java.awt.*;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.CAPTCHA_GRAPHIC)
|
||||
public class GraphicCaptchaProperties {
|
||||
|
||||
@@ -87,4 +85,65 @@ public class GraphicCaptchaProperties {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public GraphicCaptchaType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(GraphicCaptchaType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setLength(int length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public String getFontName() {
|
||||
return fontName;
|
||||
}
|
||||
|
||||
public void setFontName(String fontName) {
|
||||
this.fontName = fontName;
|
||||
}
|
||||
|
||||
public int getFontSize() {
|
||||
return fontSize;
|
||||
}
|
||||
|
||||
public void setFontSize(int fontSize) {
|
||||
this.fontSize = fontSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GraphicCaptchaProperties{" + "enabled=" + enabled + ", type=" + type + ", length=" + length + ", width=" + width + ", height=" + height + ", fontName='" + fontName + '\'' + ", fontSize=" + fontSize + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -18,8 +18,6 @@ package top.charles7c.continew.starter.captcha.graphic.enums;
|
||||
|
||||
import com.wf.captcha.*;
|
||||
import com.wf.captcha.base.Captcha;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 图形验证码类型枚举
|
||||
@@ -27,8 +25,6 @@ import lombok.RequiredArgsConstructor;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum GraphicCaptchaType {
|
||||
|
||||
/**
|
||||
@@ -60,4 +56,12 @@ public enum GraphicCaptchaType {
|
||||
* 验证码实现
|
||||
*/
|
||||
private final Class<? extends Captcha> captchaImpl;
|
||||
|
||||
GraphicCaptchaType(Class<? extends Captcha> captchaImpl) {
|
||||
this.captchaImpl = captchaImpl;
|
||||
}
|
||||
|
||||
public Class<? extends Captcha> getCaptchaImpl() {
|
||||
return captchaImpl;
|
||||
}
|
||||
}
|
@@ -19,7 +19,8 @@ package top.charles7c.continew.starter.core.autoconfigure.password;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.context.properties.EnableConfigurationProperties;
|
||||
@@ -49,11 +50,11 @@ import java.util.Map;
|
||||
* @author Jasmine
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(PasswordEncoderProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.PASSWORD_ENCODER, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
public class PasswordEncoderAutoConfiguration {
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordEncoderAutoConfiguration.class);
|
||||
|
||||
private final PasswordEncoderProperties properties;
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.autoconfigure.password;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
|
||||
@@ -26,7 +25,6 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Jasmine
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.PASSWORD_ENCODER)
|
||||
public class PasswordEncoderProperties {
|
||||
|
||||
@@ -39,4 +37,25 @@ public class PasswordEncoderProperties {
|
||||
* 启用的算法 ID
|
||||
*/
|
||||
private String encodingId;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getEncodingId() {
|
||||
return encodingId;
|
||||
}
|
||||
|
||||
public void setEncodingId(String encodingId) {
|
||||
this.encodingId = encodingId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PasswordEncoderProperties{" + "enabled=" + enabled + ", encodingId='" + encodingId + '\'' + '}';
|
||||
}
|
||||
}
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.autoconfigure.project;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
@@ -28,7 +27,6 @@ import org.springframework.context.annotation.Import;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@ComponentScan("cn.hutool.extra.spring")
|
||||
@Import(cn.hutool.extra.spring.SpringUtil.class)
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.autoconfigure.project;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "project")
|
||||
public class ProjectProperties {
|
||||
|
||||
@@ -77,7 +75,6 @@ public class ProjectProperties {
|
||||
/**
|
||||
* 联系人配置属性
|
||||
*/
|
||||
@Data
|
||||
public static class Contact {
|
||||
/**
|
||||
* 名称
|
||||
@@ -93,12 +90,40 @@ public class ProjectProperties {
|
||||
* URL
|
||||
*/
|
||||
private String url;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Contact{" + "name='" + name + '\'' + ", email='" + email + '\'' + ", url='" + url + '\'' + '}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 许可协议配置属性
|
||||
*/
|
||||
@Data
|
||||
public static class License {
|
||||
/**
|
||||
* 名称
|
||||
@@ -109,5 +134,103 @@ public class ProjectProperties {
|
||||
* URL
|
||||
*/
|
||||
private String url;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "License{" + "name='" + name + '\'' + ", url='" + url + '\'' + '}';
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getBasePackage() {
|
||||
return basePackage;
|
||||
}
|
||||
|
||||
public void setBasePackage(String basePackage) {
|
||||
this.basePackage = basePackage;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public License getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
public void setLicense(License license) {
|
||||
this.license = license;
|
||||
}
|
||||
|
||||
public boolean isProduction() {
|
||||
return production;
|
||||
}
|
||||
|
||||
public void setProduction(boolean production) {
|
||||
this.production = production;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProjectProperties{" + "name='" + name + '\'' + ", appName='" + appName + '\'' + ", version='" + version + '\'' + ", description='" + description + '\'' + ", url='" + url + '\'' + ", basePackage='" + basePackage + '\'' + ", contact=" + contact + ", license=" + license + ", production=" + production + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -17,8 +17,8 @@
|
||||
package top.charles7c.continew.starter.core.autoconfigure.threadpool;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -39,16 +39,19 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
* @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Lazy
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.THREAD_POOL, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
public class AsyncAutoConfiguration implements AsyncConfigurer {
|
||||
private static final Logger log = LoggerFactory.getLogger(AsyncAutoConfiguration.class);
|
||||
|
||||
private final ScheduledExecutorService scheduledExecutorService;
|
||||
|
||||
public AsyncAutoConfiguration(ScheduledExecutorService scheduledExecutorService) {
|
||||
this.scheduledExecutorService = scheduledExecutorService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步任务 @Async 执行时,使用 Java 内置线程池
|
||||
*/
|
||||
|
@@ -18,7 +18,8 @@ package top.charles7c.continew.starter.core.autoconfigure.threadpool;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -40,12 +41,12 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
* @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Lazy
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.THREAD_POOL, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(ThreadPoolProperties.class)
|
||||
public class ThreadPoolAutoConfiguration {
|
||||
private static final Logger log = LoggerFactory.getLogger(ThreadPoolAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* 核心(最小)线程数 = CPU 核心数 + 1
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.autoconfigure.threadpool;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
|
||||
@@ -27,7 +26,6 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.THREAD_POOL)
|
||||
public class ThreadPoolProperties {
|
||||
|
||||
@@ -55,4 +53,49 @@ public class ThreadPoolProperties {
|
||||
* 活跃时间(单位:秒)
|
||||
*/
|
||||
private int keepAliveSeconds = 300;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Integer getCorePoolSize() {
|
||||
return corePoolSize;
|
||||
}
|
||||
|
||||
public void setCorePoolSize(Integer corePoolSize) {
|
||||
this.corePoolSize = corePoolSize;
|
||||
}
|
||||
|
||||
public Integer getMaxPoolSize() {
|
||||
return maxPoolSize;
|
||||
}
|
||||
|
||||
public void setMaxPoolSize(Integer maxPoolSize) {
|
||||
this.maxPoolSize = maxPoolSize;
|
||||
}
|
||||
|
||||
public int getQueueCapacity() {
|
||||
return queueCapacity;
|
||||
}
|
||||
|
||||
public void setQueueCapacity(int queueCapacity) {
|
||||
this.queueCapacity = queueCapacity;
|
||||
}
|
||||
|
||||
public int getKeepAliveSeconds() {
|
||||
return keepAliveSeconds;
|
||||
}
|
||||
|
||||
public void setKeepAliveSeconds(int keepAliveSeconds) {
|
||||
this.keepAliveSeconds = keepAliveSeconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ThreadPoolProperties{" + "enabled=" + enabled + ", corePoolSize=" + corePoolSize + ", maxPoolSize=" + maxPoolSize + ", queueCapacity=" + queueCapacity + ", keepAliveSeconds=" + keepAliveSeconds + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,8 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
import java.util.concurrent.CancellationException;
|
||||
@@ -30,8 +31,8 @@ import java.util.function.Consumer;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExceptionUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(ExceptionUtils.class);
|
||||
|
||||
private ExceptionUtils() {
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@ import cn.hutool.core.net.NetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
|
||||
import net.dreamlu.mica.ip2region.core.IpInfo;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
@@ -34,7 +33,6 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class IpUtils {
|
||||
|
||||
private IpUtils() {
|
||||
|
@@ -16,9 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.util.db;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -29,8 +26,6 @@ import java.time.LocalDateTime;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class Table implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -69,4 +64,57 @@ public class Table implements Serializable {
|
||||
public Table(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
public void setEngine(String engine) {
|
||||
this.engine = engine;
|
||||
}
|
||||
|
||||
public String getCharset() {
|
||||
return charset;
|
||||
}
|
||||
|
||||
public void setCharset(String charset) {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(LocalDateTime createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Table{" + "tableName='" + tableName + '\'' + ", comment='" + comment + '\'' + ", engine='" + engine + '\'' + ", charset='" + charset + '\'' + ", createTime=" + createTime + ", updateTime=" + updateTime + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util.validate;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
import top.charles7c.continew.starter.core.exception.BusinessException;
|
||||
|
||||
@@ -30,7 +29,6 @@ import java.util.function.BooleanSupplier;
|
||||
* @see BusinessException
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class CheckUtils extends Validator {
|
||||
|
||||
private static final Class<BusinessException> EXCEPTION_TYPE = BusinessException.class;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util.validate;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.exception.BadRequestException;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
@@ -29,7 +28,6 @@ import java.util.function.BooleanSupplier;
|
||||
* @see BadRequestException
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class ValidationUtils extends Validator {
|
||||
|
||||
private static final Class<BadRequestException> EXCEPTION_TYPE = BadRequestException.class;
|
||||
|
@@ -19,7 +19,8 @@ package top.charles7c.continew.starter.core.util.validate;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
@@ -29,8 +30,8 @@ import java.util.function.BooleanSupplier;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class Validator {
|
||||
private static final Logger log = LoggerFactory.getLogger(Validator.class);
|
||||
|
||||
protected Validator() {
|
||||
}
|
||||
|
@@ -30,5 +30,11 @@
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.data.mybatis.plus.autoconfigure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
@@ -26,7 +25,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "mybatis-plus.extension")
|
||||
public class MyBatisPlusExtensionProperties {
|
||||
|
||||
@@ -56,7 +54,6 @@ public class MyBatisPlusExtensionProperties {
|
||||
/**
|
||||
* 数据权限插件配置属性
|
||||
*/
|
||||
@Data
|
||||
public static class DataPermissionProperties {
|
||||
|
||||
/**
|
||||
@@ -64,12 +61,23 @@ public class MyBatisPlusExtensionProperties {
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataPermissionProperties{" + "enabled=" + enabled + '}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页插件配置属性
|
||||
*/
|
||||
@Data
|
||||
public static class PaginationProperties {
|
||||
|
||||
/**
|
||||
@@ -91,5 +99,79 @@ public class MyBatisPlusExtensionProperties {
|
||||
* 单页分页条数限制(默认:-1 表示无限制)
|
||||
*/
|
||||
private Long maxLimit = -1L;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public DbType getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(DbType dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public boolean isOverflow() {
|
||||
return overflow;
|
||||
}
|
||||
|
||||
public void setOverflow(boolean overflow) {
|
||||
this.overflow = overflow;
|
||||
}
|
||||
|
||||
public Long getMaxLimit() {
|
||||
return maxLimit;
|
||||
}
|
||||
|
||||
public void setMaxLimit(Long maxLimit) {
|
||||
this.maxLimit = maxLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PaginationProperties{" + "enabled=" + enabled + ", dbType=" + dbType + ", overflow=" + overflow + ", maxLimit=" + maxLimit + '}';
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getMapperPackage() {
|
||||
return mapperPackage;
|
||||
}
|
||||
|
||||
public void setMapperPackage(String mapperPackage) {
|
||||
this.mapperPackage = mapperPackage;
|
||||
}
|
||||
|
||||
public DataPermissionProperties getDataPermission() {
|
||||
return dataPermission;
|
||||
}
|
||||
|
||||
public void setDataPermission(DataPermissionProperties dataPermission) {
|
||||
this.dataPermission = dataPermission;
|
||||
}
|
||||
|
||||
public PaginationProperties getPagination() {
|
||||
return pagination;
|
||||
}
|
||||
|
||||
public void setPagination(PaginationProperties pagination) {
|
||||
this.pagination = pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyBatisPlusExtensionProperties{" + "enabled=" + enabled + ", mapperPackage='" + mapperPackage + '\'' + ", dataPermission=" + dataPermission + ", pagination=" + pagination + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -26,8 +26,9 @@ import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerIntercep
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -46,7 +47,6 @@ import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermi
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@MapperScan("${mybatis-plus.extension.mapper-package}")
|
||||
@EnableTransactionManagement(proxyTargetClass = true)
|
||||
@@ -55,6 +55,8 @@ import top.charles7c.continew.starter.data.mybatis.plus.datapermission.DataPermi
|
||||
@PropertySource(value = "classpath:default-data-mybatis-plus.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class MybatisPlusAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MybatisPlusAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* MyBatis Plus 插件配置
|
||||
*/
|
||||
|
@@ -16,9 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.data.mybatis.plus.datapermission;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -27,7 +24,6 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
public class DataPermissionCurrentUser {
|
||||
|
||||
/**
|
||||
@@ -48,8 +44,6 @@ public class DataPermissionCurrentUser {
|
||||
/**
|
||||
* 当前用户角色信息
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class CurrentUserRole {
|
||||
|
||||
/**
|
||||
@@ -61,5 +55,63 @@ public class DataPermissionCurrentUser {
|
||||
* 数据权限
|
||||
*/
|
||||
private DataScope dataScope;
|
||||
|
||||
public CurrentUserRole() {
|
||||
}
|
||||
|
||||
public CurrentUserRole(String roleId, DataScope dataScope) {
|
||||
this.roleId = roleId;
|
||||
this.dataScope = dataScope;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public DataScope getDataScope() {
|
||||
return dataScope;
|
||||
}
|
||||
|
||||
public void setDataScope(DataScope dataScope) {
|
||||
this.dataScope = dataScope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CurrentUserRole{" + "roleId='" + roleId + '\'' + ", dataScope=" + dataScope + '}';
|
||||
}
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Set<CurrentUserRole> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(Set<CurrentUserRole> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public String getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(String deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataPermissionCurrentUser{" + "userId='" + userId + '\'' + ", roles=" + roles + ", deptId='" + deptId + '\'' + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,12 +20,11 @@ import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.handler.DataPermissionHandler;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
@@ -50,12 +49,15 @@ import net.sf.jsqlparser.statement.select.SubSelect;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class DataPermissionHandlerImpl implements DataPermissionHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DataPermissionHandlerImpl.class);
|
||||
private final DataPermissionFilter dataPermissionFilter;
|
||||
|
||||
public DataPermissionHandlerImpl(DataPermissionFilter dataPermissionFilter) {
|
||||
this.dataPermissionFilter = dataPermissionFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression getSqlSegment(Expression where, String mappedStatementId) {
|
||||
try {
|
||||
|
@@ -16,17 +16,12 @@
|
||||
|
||||
package top.charles7c.continew.starter.data.mybatis.plus.query;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 查询类型枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum QueryType {
|
||||
|
||||
/**
|
||||
|
@@ -16,12 +16,13 @@
|
||||
|
||||
package top.charles7c.continew.starter.data.mybatis.plus.query;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.exception.BadRequestException;
|
||||
import top.charles7c.continew.starter.core.util.ReflectUtils;
|
||||
import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
|
||||
@@ -39,9 +40,10 @@ import java.util.function.Consumer;
|
||||
* @author Jasmine
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class QueryWrapperHelper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(QueryWrapperHelper.class);
|
||||
|
||||
private QueryWrapperHelper() {
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,8 @@
|
||||
package top.charles7c.continew.starter.extension.crud.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -35,10 +36,11 @@ import top.charles7c.continew.starter.extension.crud.handler.CrudRequestMappingH
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class CrudRestControllerAutoConfiguration extends DelegatingWebMvcConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CrudRestControllerAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* CRUD 请求映射器处理器映射器(覆盖默认 RequestMappingHandlerMapping)
|
||||
*/
|
||||
|
@@ -19,7 +19,6 @@ package top.charles7c.continew.starter.extension.crud.base;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -31,7 +30,6 @@ import java.time.LocalDateTime;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class BaseDO implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -66,4 +64,49 @@ public class BaseDO implements Serializable {
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(Long createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(LocalDateTime createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Long getUpdateUser() {
|
||||
return updateUser;
|
||||
}
|
||||
|
||||
public void setUpdateUser(Long updateUser) {
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BaseDO{" + "id=" + id + ", createUser=" + createUser + ", createTime=" + createTime + ", updateUser=" + updateUser + ", updateTime=" + updateTime + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -21,8 +21,6 @@ import cn.crane4j.annotation.Mapping;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import top.charles7c.continew.starter.extension.crud.constant.ContainerPool;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -34,8 +32,6 @@ import java.time.LocalDateTime;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BaseDetailResp extends BaseResp {
|
||||
|
||||
@Serial
|
||||
@@ -61,4 +57,33 @@ public class BaseDetailResp extends BaseResp {
|
||||
@Schema(description = "修改时间", example = "2023-08-08 08:08:08", type = "string")
|
||||
@ExcelProperty(value = "修改时间", order = Integer.MAX_VALUE - 1)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public Long getUpdateUser() {
|
||||
return updateUser;
|
||||
}
|
||||
|
||||
public void setUpdateUser(Long updateUser) {
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public String getUpdateUserString() {
|
||||
return updateUserString;
|
||||
}
|
||||
|
||||
public void setUpdateUserString(String updateUserString) {
|
||||
this.updateUserString = updateUserString;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BaseDetailResp{" + "updateUser=" + updateUser + ", updateUserString='" + updateUserString + '\'' + ", updateTime=" + updateTime + "} " + super.toString();
|
||||
}
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.extension.crud.base;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -27,7 +25,6 @@ import java.io.Serializable;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class BaseReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
@@ -22,7 +22,6 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.extension.crud.constant.ContainerPool;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -35,7 +34,6 @@ import java.time.LocalDateTime;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class BaseResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -75,4 +73,49 @@ public class BaseResp implements Serializable {
|
||||
@Schema(description = "是否禁用修改", example = "true")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Boolean disabled;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(Long createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public String getCreateUserString() {
|
||||
return createUserString;
|
||||
}
|
||||
|
||||
public void setCreateUserString(String createUserString) {
|
||||
this.createUserString = createUserString;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(LocalDateTime createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Boolean getDisabled() {
|
||||
return disabled;
|
||||
}
|
||||
|
||||
public void setDisabled(Boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BaseResp{" + "id=" + id + ", createUser=" + createUser + ", createUserString='" + createUserString + '\'' + ", createTime=" + createTime + ", disabled=" + disabled + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -23,8 +23,6 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.data.domain.Sort;
|
||||
@@ -37,9 +35,7 @@ import java.io.Serial;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ParameterObject
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "分页查询条件")
|
||||
public class PageQuery extends SortQuery {
|
||||
|
||||
@@ -87,4 +83,25 @@ public class PageQuery extends SortQuery {
|
||||
}
|
||||
return mybatisPage;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(Integer size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PageQuery{" + "page=" + page + ", size=" + size + "} " + super.toString();
|
||||
}
|
||||
}
|
||||
|
@@ -19,13 +19,13 @@ package top.charles7c.continew.starter.extension.crud.model.query;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,6 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "排序查询条件")
|
||||
public class SortQuery implements Serializable {
|
||||
|
||||
@@ -73,4 +72,13 @@ public class SortQuery implements Serializable {
|
||||
}
|
||||
return Sort.by(orders);
|
||||
}
|
||||
|
||||
public void setSort(String[] sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SortQuery{" + "sort=" + Arrays.toString(sort) + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -34,7 +33,6 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "分页信息")
|
||||
public class PageResp<L> implements Serializable {
|
||||
|
||||
@@ -128,4 +126,25 @@ public class PageResp<L> implements Serializable {
|
||||
pageResp.setList(new ArrayList<>(0));
|
||||
return pageResp;
|
||||
}
|
||||
|
||||
public List<L> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<L> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PageResp{" + "list=" + list + ", total=" + total + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,8 @@ import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import top.charles7c.continew.starter.core.exception.BaseException;
|
||||
import top.charles7c.continew.starter.file.excel.converter.ExcelBigNumberConverter;
|
||||
|
||||
@@ -35,9 +36,10 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExcelUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ExcelUtils.class);
|
||||
|
||||
private ExcelUtils() {
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,8 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -45,10 +46,10 @@ import java.util.TimeZone;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@PropertySource(value = "classpath:default-json-jackson.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class JacksonAutoConfiguration {
|
||||
private static final Logger log = LoggerFactory.getLogger(JacksonAutoConfiguration.class);
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.log.common.model;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.log.common.enums.Include;
|
||||
|
||||
import java.time.Clock;
|
||||
@@ -33,7 +32,6 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
public class LogRecord {
|
||||
|
||||
/**
|
||||
@@ -134,4 +132,53 @@ public class LogRecord {
|
||||
return new LogRecord(this.timestamp, logRequest, logResponse, duration);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getModule() {
|
||||
return module;
|
||||
}
|
||||
|
||||
public void setModule(String module) {
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
public LogRequest getRequest() {
|
||||
return request;
|
||||
}
|
||||
|
||||
public void setRequest(LogRequest request) {
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
public LogResponse getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
public void setResponse(LogResponse response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
public Duration getTimeTaken() {
|
||||
return timeTaken;
|
||||
}
|
||||
|
||||
public void setTimeTaken(Duration timeTaken) {
|
||||
this.timeTaken = timeTaken;
|
||||
}
|
||||
|
||||
public Instant getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogRecord{" + "description='" + description + '\'' + ", module='" + module + '\'' + ", request=" + request + ", response=" + response + ", timeTaken=" + timeTaken + ", timestamp=" + timestamp + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.charles7c.continew.starter.log.common.model;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import top.charles7c.continew.starter.core.util.ExceptionUtils;
|
||||
import top.charles7c.continew.starter.core.util.IpUtils;
|
||||
@@ -34,7 +33,6 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
public class LogRequest {
|
||||
|
||||
/**
|
||||
@@ -99,4 +97,81 @@ public class LogRequest {
|
||||
this.os = (includes.contains(Include.OS)) ? ServletUtils.getOs(userAgentString) : null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public URI getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(URI url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public Map<String, String> getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public void setHeaders(Map<String, String> headers) {
|
||||
this.headers = headers;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParam() {
|
||||
return param;
|
||||
}
|
||||
|
||||
public void setParam(Map<String, Object> param) {
|
||||
this.param = param;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getBrowser() {
|
||||
return browser;
|
||||
}
|
||||
|
||||
public void setBrowser(String browser) {
|
||||
this.browser = browser;
|
||||
}
|
||||
|
||||
public String getOs() {
|
||||
return os;
|
||||
}
|
||||
|
||||
public void setOs(String os) {
|
||||
this.os = os;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogRequest{" + "method='" + method + '\'' + ", url=" + url + ", ip='" + ip + '\'' + ", headers=" + headers + ", body='" + body + '\'' + ", param=" + param + ", address='" + address + '\'' + ", browser='" + browser + '\'' + ", os='" + os + '\'' + '}';
|
||||
}
|
||||
}
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.log.common.model;
|
||||
|
||||
import lombok.Data;
|
||||
import top.charles7c.continew.starter.log.common.enums.Include;
|
||||
|
||||
import java.util.*;
|
||||
@@ -27,7 +26,6 @@ import java.util.*;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
public class LogResponse {
|
||||
|
||||
/**
|
||||
@@ -59,4 +57,41 @@ public class LogResponse {
|
||||
this.param = response.getParam();
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Map<String, String> getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public void setHeaders(Map<String, String> headers) {
|
||||
this.headers = headers;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParam() {
|
||||
return param;
|
||||
}
|
||||
|
||||
public void setParam(Map<String, Object> param) {
|
||||
this.param = param;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogResponse{" + "status=" + status + ", headers=" + headers + ", body='" + body + '\'' + ", param=" + param + '}';
|
||||
}
|
||||
}
|
@@ -17,8 +17,8 @@
|
||||
package top.charles7c.continew.starter.log.httptracepro.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -37,16 +37,19 @@ import top.charles7c.continew.starter.log.httptracepro.handler.LogInterceptor;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@ConditionalOnEnabledLog
|
||||
@RequiredArgsConstructor
|
||||
@EnableConfigurationProperties(LogProperties.class)
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
public class LogAutoConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LogAutoConfiguration.class);
|
||||
private final LogProperties logProperties;
|
||||
|
||||
public LogAutoConfiguration(LogProperties logProperties) {
|
||||
this.logProperties = logProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LogInterceptor(logDao(), logProperties));
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.log.httptracepro.autoconfigure;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
import top.charles7c.continew.starter.log.common.enums.Include;
|
||||
@@ -30,7 +29,6 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.LOG)
|
||||
public class LogProperties {
|
||||
|
||||
@@ -48,4 +46,33 @@ public class LogProperties {
|
||||
* 包含信息
|
||||
*/
|
||||
private Set<Include> include = new HashSet<>(Include.defaultIncludes());
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Boolean getIsPrint() {
|
||||
return isPrint;
|
||||
}
|
||||
|
||||
public void setIsPrint(Boolean print) {
|
||||
isPrint = print;
|
||||
}
|
||||
|
||||
public Set<Include> getInclude() {
|
||||
return include;
|
||||
}
|
||||
|
||||
public void setInclude(Set<Include> include) {
|
||||
this.include = include;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogProperties{" + "enabled=" + enabled + ", isPrint=" + isPrint + ", include=" + include + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
@@ -47,11 +46,14 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class LogFilter extends OncePerRequestFilter implements Ordered {
|
||||
|
||||
private final LogProperties logProperties;
|
||||
|
||||
public LogFilter(LogProperties logProperties) {
|
||||
this.logProperties = logProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.LOWEST_PRECEDENCE - 10;
|
||||
|
@@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
@@ -46,14 +46,18 @@ import java.util.Set;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class LogInterceptor implements HandlerInterceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
|
||||
private final LogDao logDao;
|
||||
private final LogProperties logProperties;
|
||||
private final TransmittableThreadLocal<LogRecord.Started> timestampTtl = new TransmittableThreadLocal<>();
|
||||
|
||||
public LogInterceptor(LogDao logDao, LogProperties logProperties) {
|
||||
this.logDao = logDao;
|
||||
this.logProperties = logProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandle(@NonNull HttpServletRequest request,
|
||||
@NonNull HttpServletResponse response,
|
||||
|
@@ -17,7 +17,8 @@
|
||||
package top.charles7c.continew.starter.messaging.mail.autoconfigure;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
|
||||
@@ -28,11 +29,12 @@ import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@PropertySource(value = "classpath:default-messaging-mail.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class MailAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MailAutoConfiguration.class);
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'Mail' completed initialization.");
|
||||
|
@@ -23,7 +23,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
import lombok.Data;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
@@ -40,7 +39,6 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class MailUtils {
|
||||
|
||||
private static final JavaMailSender MAIL_SENDER = SpringUtil.getBean(JavaMailSender.class);
|
||||
@@ -207,4 +205,5 @@ public class MailUtils {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -18,8 +18,8 @@ package top.charles7c.continew.starter.storage.local.autoconfigure;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.context.properties.EnableConfigurationProperties;
|
||||
@@ -37,16 +37,19 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@EnableConfigurationProperties(LocalStorageProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LocalStorageAutoConfiguration.class);
|
||||
private final LocalStorageProperties properties;
|
||||
|
||||
public LocalStorageAutoConfiguration(LocalStorageProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
Map<String, LocalStorageProperties.LocalStorageMapping> mappingMap = properties.getMapping();
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.storage.local.autoconfigure;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -30,7 +29,6 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.STORAGE_LOCAL)
|
||||
public class LocalStorageProperties {
|
||||
|
||||
@@ -47,7 +45,6 @@ public class LocalStorageProperties {
|
||||
/**
|
||||
* 本地存储映射
|
||||
*/
|
||||
@Data
|
||||
public static class LocalStorageMapping {
|
||||
|
||||
/**
|
||||
@@ -64,5 +61,55 @@ public class LocalStorageProperties {
|
||||
* 单文件上传大小限制
|
||||
*/
|
||||
private DataSize maxFileSize = DataSize.ofMegabytes(1);
|
||||
|
||||
public String getPathPattern() {
|
||||
return pathPattern;
|
||||
}
|
||||
|
||||
public void setPathPattern(String pathPattern) {
|
||||
this.pathPattern = pathPattern;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public DataSize getMaxFileSize() {
|
||||
return maxFileSize;
|
||||
}
|
||||
|
||||
public void setMaxFileSize(DataSize maxFileSize) {
|
||||
this.maxFileSize = maxFileSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocalStorageMapping{" + "pathPattern='" + pathPattern + '\'' + ", location='" + location + '\'' + ", maxFileSize=" + maxFileSize + '}';
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Map<String, LocalStorageMapping> getMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public void setMapping(Map<String, LocalStorageMapping> mapping) {
|
||||
this.mapping = mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocalStorageProperties{" + "enabled=" + enabled + ", mapping=" + mapping + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,8 @@
|
||||
|
||||
package top.charles7c.continew.starter.web.autoconfigure.cors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -36,13 +37,13 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Lazy
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CORS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(CorsProperties.class)
|
||||
public class CorsAutoConfiguration {
|
||||
private static final Logger log = LoggerFactory.getLogger(CorsAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* 跨域过滤器
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.web.autoconfigure.cors;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
@@ -31,7 +30,6 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.CORS)
|
||||
public class CorsProperties {
|
||||
|
||||
@@ -61,4 +59,49 @@ public class CorsProperties {
|
||||
private List<String> exposedHeaders = new ArrayList<>();
|
||||
|
||||
private static final List<String> ALL = Collections.singletonList(StringConstants.ASTERISK);
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public List<String> getAllowedOrigins() {
|
||||
return allowedOrigins;
|
||||
}
|
||||
|
||||
public void setAllowedOrigins(List<String> allowedOrigins) {
|
||||
this.allowedOrigins = allowedOrigins;
|
||||
}
|
||||
|
||||
public List<String> getAllowedMethods() {
|
||||
return allowedMethods;
|
||||
}
|
||||
|
||||
public void setAllowedMethods(List<String> allowedMethods) {
|
||||
this.allowedMethods = allowedMethods;
|
||||
}
|
||||
|
||||
public List<String> getAllowedHeaders() {
|
||||
return allowedHeaders;
|
||||
}
|
||||
|
||||
public void setAllowedHeaders(List<String> allowedHeaders) {
|
||||
this.allowedHeaders = allowedHeaders;
|
||||
}
|
||||
|
||||
public List<String> getExposedHeaders() {
|
||||
return exposedHeaders;
|
||||
}
|
||||
|
||||
public void setExposedHeaders(List<String> exposedHeaders) {
|
||||
this.exposedHeaders = exposedHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CorsProperties{" + "enabled=" + enabled + ", allowedOrigins=" + allowedOrigins + ", allowedMethods=" + allowedMethods + ", allowedHeaders=" + allowedHeaders + ", exposedHeaders=" + exposedHeaders + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,8 +20,9 @@ import jakarta.annotation.PostConstruct;
|
||||
import jakarta.validation.Validation;
|
||||
import jakarta.validation.Validator;
|
||||
import jakarta.validation.ValidatorFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hibernate.validator.HibernateValidator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
|
||||
@@ -38,12 +39,13 @@ import top.charles7c.continew.starter.web.core.exception.GlobalExceptionHandler;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Import({GlobalExceptionHandler.class, GlobalErrorHandler.class})
|
||||
@ConditionalOnMissingBean(BasicErrorController.class)
|
||||
public class GlobalExceptionHandlerAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandlerAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* Validator 失败立即返回模式配置
|
||||
*
|
||||
|
@@ -22,7 +22,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver;
|
||||
@@ -44,10 +45,11 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class GlobalErrorHandler extends BasicErrorController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalErrorHandler.class);
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
|
@@ -22,7 +22,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.ConstraintViolation;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.BindException;
|
||||
@@ -43,9 +44,9 @@ import top.charles7c.continew.starter.web.model.R;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||
|
||||
private static final String PARAM_FAILED = "请求地址 [{}],参数验证失败。";
|
||||
|
||||
|
@@ -18,7 +18,6 @@ package top.charles7c.continew.starter.web.model;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -30,7 +29,6 @@ import java.io.Serializable;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "响应信息")
|
||||
public class R<T> implements Serializable {
|
||||
|
||||
@@ -179,4 +177,49 @@ public class R<T> implements Serializable {
|
||||
public static <T> R<T> fail(int code, String msg) {
|
||||
return new R<>(false, code, msg, null);
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "R{" + "success=" + success + ", code=" + code + ", msg='" + msg + '\'' + ", data=" + data + ", timestamp=" + timestamp + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,8 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.file.FileNameUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
@@ -33,8 +34,8 @@ import java.time.LocalDateTime;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class FileUploadUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(FileUploadUtils.class);
|
||||
|
||||
private FileUploadUtils() {
|
||||
}
|
||||
|
9
pom.xml
9
pom.xml
@@ -82,15 +82,6 @@
|
||||
<module>continew-starter-extension</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<!-- Lombok(在 Java 开发过程中用注解的方式,简化了 JavaBean 的编写,避免了冗余和样板式代码,让编写的类更加简洁) -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会被传递 -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 代码格式化插件 -->
|
||||
|
Reference in New Issue
Block a user