refactor(plugin): 简化插件模块代码,复用BaseService方法

This commit is contained in:
xiaojunnuo
2026-08-02 02:48:39 +08:00
parent 255960d434
commit 0bf323ab97
7 changed files with 124 additions and 248 deletions
@@ -102,6 +102,18 @@ export abstract class BaseService<T> {
});
}
/**
* 按条件直接更新,不触发子类 update 的业务生命周期。
*/
async updateWhere(where: any, data: any) {
await this.getRepository().update(
{
...where,
},
data
);
}
/**
* 删除
* @param ids 删除的ID集合 如:[1,2,3] 或者 1,2,3