mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 20:57:23 +08:00
refactor(extension/crud): 移除 Crane4j 依赖方便使用者自定义实现
This commit is contained in:
@@ -39,11 +39,5 @@
|
|||||||
<groupId>top.continew.starter</groupId>
|
<groupId>top.continew.starter</groupId>
|
||||||
<artifactId>continew-starter-excel-fastexcel</artifactId>
|
<artifactId>continew-starter-excel-fastexcel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Crane4j(基于注解的,用于完成一切 “根据 A 的 key 值拿到 B,再把 B 的属性映射到 A” 这类需求的字段填充框架) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.crane4j</groupId>
|
|
||||||
<artifactId>crane4j-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package top.continew.starter.extension.crud.service;
|
package top.continew.starter.extension.crud.service;
|
||||||
|
|
||||||
import cn.crane4j.core.support.OperateTemplate;
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
@@ -214,19 +213,6 @@ public abstract class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 填充数据
|
|
||||||
*
|
|
||||||
* @param obj 待填充信息
|
|
||||||
*/
|
|
||||||
protected void fill(Object obj) {
|
|
||||||
if (obj == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);
|
|
||||||
operateTemplate.execute(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建 QueryWrapper
|
* 构建 QueryWrapper
|
||||||
*
|
*
|
||||||
@@ -239,6 +225,14 @@ public abstract class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
|||||||
return QueryWrapperHelper.build(query, queryFields, queryWrapper);
|
return QueryWrapperHelper.build(query, queryFields, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充数据
|
||||||
|
*
|
||||||
|
* @param obj 待填充信息
|
||||||
|
*/
|
||||||
|
protected void fill(Object obj) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增前置处理
|
* 新增前置处理
|
||||||
*
|
*
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package top.continew.starter.extension.crud.service;
|
package top.continew.starter.extension.crud.service;
|
||||||
|
|
||||||
import cn.crane4j.core.support.OperateTemplate;
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
@@ -304,19 +303,6 @@ public abstract class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 填充数据
|
|
||||||
*
|
|
||||||
* @param obj 待填充信息
|
|
||||||
*/
|
|
||||||
protected void fill(Object obj) {
|
|
||||||
if (obj == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);
|
|
||||||
operateTemplate.execute(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建 QueryWrapper
|
* 构建 QueryWrapper
|
||||||
*
|
*
|
||||||
@@ -329,6 +315,14 @@ public abstract class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
|||||||
return QueryWrapperHelper.build(query, this.getQueryFields(), queryWrapper);
|
return QueryWrapperHelper.build(query, this.getQueryFields(), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充数据
|
||||||
|
*
|
||||||
|
* @param obj 待填充信息
|
||||||
|
*/
|
||||||
|
protected void fill(Object obj) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增前置处理
|
* 新增前置处理
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user