添加配置检查策略.
This commit is contained in:
@@ -26,14 +26,14 @@ public enum BooleanBit {
|
||||
|
||||
;
|
||||
|
||||
private final Integer v;
|
||||
private final Integer value;
|
||||
|
||||
public static BooleanBit of(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (BooleanBit e : values()) {
|
||||
if (e.v.equals(value)) {
|
||||
if (e.value.equals(value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,4 +105,15 @@ public class Valid extends com.orion.lang.utils.Valid {
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否更新成功
|
||||
*
|
||||
* @param effect effect
|
||||
* @return effect
|
||||
*/
|
||||
public static int version(int effect) {
|
||||
isTrue(effect > 0, ErrorMessage.DATA_MODIFIED);
|
||||
return effect;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.orion.ops.framework.mybatis.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.orion.ops.framework.common.constant.AutoConfigureOrderConst;
|
||||
import com.orion.ops.framework.common.constant.FilterOrderConst;
|
||||
import com.orion.ops.framework.common.filter.FilterCreator;
|
||||
@@ -37,6 +39,18 @@ public class OrionMybatisAutoConfiguration {
|
||||
return new FieldFillHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册 乐观锁插件
|
||||
*
|
||||
* @return 拦截器
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mybatis 缓存清理过滤器
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user