1
0

refactor(service): 将删除服务接口参数类型从 Iterable 改为 Set

This commit is contained in:
2026-01-07 11:29:03 +08:00
parent d08f9db9ac
commit af4be9db8f
2 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
package com.lanyuanxiaoyao.service.template.common.service;
import java.util.Set;
/**
* 删除服务接口,用于定义统一的删除实体对象的服务规范
* <p>
@@ -33,5 +35,5 @@ public interface RemoveService<ENTITY> {
* @param ids 需要删除的实体ID集合
* @throws Exception 删除过程中可能抛出的异常
*/
void remove(Iterable<Long> ids) throws Exception;
void remove(Set<Long> ids) throws Exception;
}

View File

@@ -593,7 +593,7 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
*/
@Transactional(rollbackOn = Throwable.class)
@Override
public void remove(Iterable<Long> ids) {
public void remove(Set<Long> ids) {
if (ObjectHelper.isNotEmpty(ids)) {
repository.deleteBatchByIds(ids);
}