mirror of
				https://github.com/continew-org/continew-starter.git
				synced 2025-10-31 22:57:19 +08:00 
			
		
		
		
	chore: 移除 lombok 依赖
再度精简依赖
This commit is contained in:
		| @@ -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() { | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jasmine
					jasmine