安全组相关代码优化.

This commit is contained in:
aoshiguchen
2023-12-10 20:43:23 +08:00
parent 306cd66034
commit bb96caca64
6 changed files with 34 additions and 27 deletions
@@ -72,6 +72,8 @@ public class SecurityController {
@Post
@Mapping("/group/delete")
public void deleteGroup(Integer groupId) {
ParamCheckUtil.checkNotNull(groupId, "groupId");
groupService.deleteGroup(groupId);
}
@@ -1,6 +1,7 @@
package org.dromara.neutrinoproxy.server.controller.req.system;
import lombok.Data;
import org.dromara.neutrinoproxy.server.constant.SecurityRulePassTypeEnum;
/**
* @author: wen.y
@@ -9,5 +10,13 @@ import lombok.Data;
@Data
public class SecurityGroupListReq {
private String name;
/**
* 描述
*/
private String description;
/**
* 通过类型
*/
private SecurityRulePassTypeEnum defaultPassType;
private Integer enable;
}
@@ -73,6 +73,10 @@ public class SecurityGroupService {
//描述字段为模糊查询,在应用层处理,否则sqlite不支持
req.setName("%" + req.getName() + "%");
}
if (StringUtils.isNotEmpty(req.getDescription())) {
//描述字段为模糊查询,在应用层处理,否则sqlite不支持
req.setDescription("%" + req.getDescription() + "%");
}
Page<SecurityGroupDO> page = new Page<>(pageQuery.getCurrent(), pageQuery.getSize());
List<SecurityGroupDO> list = securityGroupMapper.selectByCondition(page, req);
if (CollectionUtils.isEmpty(list)) {