1、系统管理-端口池管理添加批量删除的功能

2、代理配置-端口映射添加和编辑页面服务端端口字段,支持输入搜索的功能
This commit is contained in:
Metal
2023-07-04 20:08:27 +08:00
parent 1625187bb1
commit 7ea723b578
9 changed files with 126 additions and 49 deletions
@@ -123,4 +123,14 @@ public class PortPoolController {
ParamCheckUtil.checkNotEmpty(req.getPortIdList(), "portIdList");
return portPoolService.updateGroup(req);
}
@Post
@Mapping("/deleteBatch")
@Authorization(onlyAdmin = true)
public void deleteBatch(PortPoolDeleteBatchReq req) {
ParamCheckUtil.checkNotNull(req, "req");
ParamCheckUtil.checkNotNull(req.getIds(), "ids");
portPoolService.deleteBatch(req.getIds());
}
}
@@ -0,0 +1,14 @@
package org.dromara.neutrinoproxy.server.controller.req.system;
import lombok.Data;
import java.util.List;
/**
* @author: Metal
* @date: 2023/7/3
*/
@Data
public class PortPoolDeleteBatchReq {
private List<Integer> ids;
}
@@ -179,4 +179,15 @@ public class PortPoolService {
LicenseDO licenseDO = licenseMapper.queryById(req.getLicenseId());
return portPoolMapper.getAvailablePortList(req.getLicenseId(), licenseDO.getUserId());
}
public void deleteBatch(List<Integer> ids) {
List<PortPoolDO> portPoolDOList = portPoolMapper.selectBatchIds(ids);
ParamCheckUtil.checkNotNull(portPoolDOList, ExceptionConstant.PORT_NOT_EXIST);
portPoolMapper.deleteBatchIds(ids);
// 更新visitorChannel
portPoolDOList.stream().forEach(portPoolDO -> {
visitorChannelService.updateVisitorChannelByPortPool(portPoolDO.getPort(), EnableStatusEnum.DISABLE.getStatus());
});
}
}