Skip to content

Commit

Permalink
Merge pull request #15 from buession/2.3.x
Browse files Browse the repository at this point in the history
Release 2.3.2
  • Loading branch information
eduosi authored Dec 27, 2023
2 parents 662cee2 + e77c5ad commit 09bfe57
Show file tree
Hide file tree
Showing 276 changed files with 6,780 additions and 3,059 deletions.
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,71 @@
===========================


## [2.3.2](https://github.com/buession/buessionframework/releases/tag/v2.3.2) (2023-12-27)

### 🔨依赖升级

- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.3.2)


### ⭐ 新特性

- **buession-core:** ClassUtils、MethodUtils、FieldUtils 增加检测是否含义任意注解的方法
- **buession-core:** AnnotationUtils 增加检测属性是否含义任意注解的方法
- **buession-core:** 断言 Assert 可指定异常
- **buession-core:** 新增对象工具类 ObjectUtils
- **buession-core:** AbstractBeanConverter 新增支持 String 转枚举
- **buession-core:** 新增反射工具类 ReflectionUtils
- **buession-aop:** 新增注解处理器支持解析注解属性中的变量
- **buession-json:** 注解 @Sensitive 增加支持邮箱脱敏
- **buession-httpclient:** OKHTTP client 增加可设置 maxRequests
- **buession-velocity:** 新增验证工具 ValidateTool
- **buession-web:** 新增注解处理器支持解析注解属性中的变量


### 🔔 变化

- **buession-core:** 废弃 JsonSerializer 和 JsonDeserializer
- **buession-core:** ListConverter、SetConverter、MapConverter 默认返回原始类型
- **buession-core:** 移除 spring-beans 依赖
- **buession-json:** 注解 @Sensitive 内容替换策略,替换符可通过属性 replacement 设置


### 🐞 Bug 修复

- **buession-core:** 修改错误的类名 BuesssionFrameworkVersion 为 BuessionFrameworkVersion
- **buession-beans:** 修复 NumberPropertyConverter 字符串转换为数字时异常的 BUG
- **buession-beans:** 修复 Map 转换为 bean 时字段为 null 值的 BUG
- **buession-beans:** 修复 Map 转换为 bean 或 bean 转换为 map 时缓存导致的异常
- **buession-dao:** 修复分页插件 PaginationInterceptor 当页码大于等于 2 时,无法返回数据的 BUG
- **buession-dao:** 修复分页对象下一页值错误的 BUG
- **buession-git:** 修复无法解析 git 信息时,空指针异常
- **buession-web:** 修复分页对象下一页值错误的 BUG


### ⏪ 优化

- **buession-beans:** 代码优化
- **buession-httpclient:** 代码优化
- **buession-redis:** 代码优化
- **buession-redis:** 优化 RedisAccessor 多次调用 afterPropertiesSet 时,重复初始化 RedisConnectionFactory
- **buession-geoip:** 优化 GeoIPResolverFactoryBean 多次调用 afterPropertiesSet 时,重复初始化 DatabaseResolver
- **buession-thesaurus:** 优化 ThesaurusFactoryBean 多次调用 afterPropertiesSet 时,重复初始化 Parser
- **buession-velocity:** 优化 VelocityEngineFactoryBean 多次调用 afterPropertiesSet 时,重复初始化 VelocityEngine


### 📔 文档

- **buession-aop:** 完善注释
- **buession-httpclient:** 完善注释
- **buession-redis:** 完善注释
- **buession-velocity:** 完善注释
- **buession-web:** 完善注释


---


## [2.3.1](https://github.com/buession/buessionframework/releases/tag/v2.3.1) (2023-11-17)

### 🔨依赖升级
Expand Down
2 changes: 1 addition & 1 deletion buession-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>
<artifactId>buession-aop</artifactId>
<url>http://www.buession.com/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ public AbstractAspectjAnnotationsMethodInterceptor() {
super();
}

/**
* 切点方法之前执行
*
* @param joinPoint
* {@link JoinPoint}
*
* @throws Throwable
* 异常
*/
public void performBeforeInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
Expand All @@ -57,6 +66,15 @@ public void performBeforeInterception(JoinPoint joinPoint) throws Throwable {
super.invoke(mi);
}

/**
* 切点方法之后执行
*
* @param joinPoint
* {@link JoinPoint}
*
* @throws Throwable
* 异常
*/
public void performAfterInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
Expand All @@ -69,6 +87,13 @@ public void performAfterInterception(JoinPoint joinPoint) throws Throwable {
}

/**
* 切点方法的返回值并进行增强
*
* @param joinPoint
* {@link JoinPoint}
*
* @throws Throwable
* 异常
* @since 2.3.0
*/
public void performAfterReturningInterception(JoinPoint joinPoint) throws Throwable {
Expand All @@ -84,6 +109,13 @@ public void performAfterReturningInterception(JoinPoint joinPoint) throws Throwa
}

/**
* 切点方法的返回值后执行
*
* @param joinPoint
* {@link JoinPoint}
*
* @throws Throwable
* 异常
* @since 2.3.0
*/
public void performAfterThrowingInterception(JoinPoint joinPoint) throws Throwable {
Expand All @@ -99,6 +131,8 @@ public void performAfterThrowingInterception(JoinPoint joinPoint) throws Throwab
}

/**
* 点方法抛出异常时会执行
*
* @since 2.3.0
*/
public void performAroundInterception(JoinPoint joinPoint) throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <[email protected]> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.aop.handler;

import com.buession.core.utils.Assert;
import org.springframework.util.StringValueResolver;

import java.lang.annotation.Annotation;

Expand All @@ -43,23 +44,46 @@ public abstract class AbstractAnnotationHandler<A extends Annotation> implements
*/
protected Class<A> annotationClass;

/**
* 占位符解析器
*
* @since 2.3.2
*/
protected StringValueResolver stringValueResolver;

/**
* 构造函数
*
* @param annotationClass
* 注解类
*/
@Deprecated
public AbstractAnnotationHandler(Class<A> annotationClass) {
setAnnotationClass(annotationClass);
}

/**
* 构造函数
*
* @param annotationClass
* 注解类
* @param stringValueResolver
* 占位符解析器
*
* @since 2.3.2
*/
public AbstractAnnotationHandler(Class<A> annotationClass){
public AbstractAnnotationHandler(Class<A> annotationClass, StringValueResolver stringValueResolver) {
setAnnotationClass(annotationClass);
this.stringValueResolver = stringValueResolver;
}

@Override
public Class<A> getAnnotationClass(){
public Class<A> getAnnotationClass() {
return annotationClass;
}

@Override
public void setAnnotationClass(Class<A> annotationClass){
public void setAnnotationClass(Class<A> annotationClass) {
Assert.isNull(annotationClass, "Annotation class argument could not be null");
this.annotationClass = annotationClass;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <[email protected]> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.aop.interceptor;

import com.buession.core.utils.AnnotationUtils;
import com.buession.core.utils.Assert;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.core.annotation.AnnotationUtils;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Expand All @@ -42,7 +42,7 @@ public abstract class AbstractAttributeSourceAdvisor extends StaticMethodMatcher
private final Class<? extends Annotation>[] annotations;

public AbstractAttributeSourceAdvisor(final AnnotationsMethodInterceptor annotationsMethodInterceptor,
final Class<? extends Annotation>[] annotations){
final Class<? extends Annotation>[] annotations) {
Assert.isNull(annotationsMethodInterceptor, "AnnotationsMethodInterceptor cloud not be null.");
Assert.isNull(annotations, "Annotations cloud not be null.");

Expand All @@ -51,7 +51,7 @@ public AbstractAttributeSourceAdvisor(final AnnotationsMethodInterceptor annotat
}

@Override
public boolean matches(Method method, Class<?> targetClass){
public boolean matches(Method method, Class<?> targetClass) {
Method m = method;

if(isAnnotationPresent(m)){
Expand All @@ -70,26 +70,12 @@ public boolean matches(Method method, Class<?> targetClass){
return false;
}

private boolean isAnnotationPresent(final Class<?> targetClazz){
for(Class<? extends Annotation> annotationClass : annotations){
Annotation annotation = AnnotationUtils.findAnnotation(targetClazz, annotationClass);
if(annotation != null){
return true;
}
}

return false;
private boolean isAnnotationPresent(final Class<?> targetClazz) {
return AnnotationUtils.hasClassAnnotationPresent(targetClazz, annotations);
}

private boolean isAnnotationPresent(final Method method){
for(Class<? extends Annotation> annotationClass : annotations){
Annotation annotation = AnnotationUtils.findAnnotation(method, annotationClass);
if(annotation != null){
return true;
}
}

return false;
private boolean isAnnotationPresent(final Method method) {
return AnnotationUtils.hasMethodAnnotationPresent(method, annotations);
}

}
2 changes: 1 addition & 1 deletion buession-beans/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>
<artifactId>buession-beans</artifactId>
<url>http://www.buession.com/</url>
Expand Down
Loading

0 comments on commit 09bfe57

Please sign in to comment.