【同步】BOOT 和 CLOUD 的功能

This commit is contained in:
YunaiV
2025-05-23 10:02:08 +08:00
parent 70c2ddf66d
commit 7a0d5bd29a
76 changed files with 2199 additions and 640 deletions

View File

@@ -53,4 +53,14 @@ public abstract class BaseDO implements Serializable, TransPojo {
@TableLogic
private Boolean deleted;
/**
* 把 creator、createTime、updateTime、updater 都清空,避免前端直接传递 creator 之类的字段,直接就被更新了
*/
public void clean(){
this.creator = null;
this.createTime = null;
this.updater = null;
this.updateTime = null;
}
}

View File

@@ -215,4 +215,11 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
return delete(new LambdaQueryWrapper<T>().eq(field, value));
}
default int deleteBatch(SFunction<T, ?> field, Collection<?> values) {
if (CollUtil.isEmpty(values)) {
return 0;
}
return delete(new LambdaQueryWrapper<T>().in(field, values));
}
}