feat: 添加 spring-boot-mybatis starter.
This commit is contained in:
@@ -13,4 +13,6 @@ public interface FilterOrderConst {
|
||||
|
||||
int TRICE_ID_FILTER = Integer.MIN_VALUE + 10;
|
||||
|
||||
int MYBATIS_CACHE_CLEAR_FILTER = Integer.MIN_VALUE + 100000;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.orion.ops.framework.common.filter;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
|
||||
/**
|
||||
* 过滤器构造器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/25 15:05
|
||||
*/
|
||||
public class FilterCreator {
|
||||
|
||||
private FilterCreator() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建过滤器
|
||||
*
|
||||
* @param filter filter
|
||||
* @param order order
|
||||
* @param <T> type
|
||||
* @return filter bean
|
||||
*/
|
||||
public static <T extends Filter> FilterRegistrationBean<T> create(T filter, Integer order) {
|
||||
FilterRegistrationBean<T> bean = new FilterRegistrationBean<>(filter);
|
||||
bean.setOrder(order);
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user