端口映射的安全组解绑设置值为0
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ public class PortMappingDO {
|
||||
/**
|
||||
* 安全组Id
|
||||
*/
|
||||
private Integer securityGroupId;
|
||||
private Integer securityGroupId = 0; // 设置为null不生效,不知道为啥
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
+4
-1
@@ -187,6 +187,9 @@ public class PortMappingService implements LifecycleBean {
|
||||
|
||||
PortMappingDO portMappingDO = new PortMappingDO();
|
||||
BeanUtil.copyProperties(req, portMappingDO);
|
||||
if (req.getSecurityGroupId() == null) {
|
||||
portMappingDO.setSecurityGroupId(0);
|
||||
}
|
||||
portMappingDO.setUpdateTime(new Date());
|
||||
portMappingDO.setEnable(EnableStatusEnum.ENABLE.getStatus());
|
||||
portMappingMapper.updateById(portMappingDO);
|
||||
@@ -292,7 +295,7 @@ public class PortMappingService implements LifecycleBean {
|
||||
if (mappingDO == null) {
|
||||
throw new RuntimeException("指定的端口映射不存在");
|
||||
}
|
||||
mappingDO.setSecurityGroupId(null);
|
||||
mappingDO.setSecurityGroupId(0);
|
||||
mappingDO.setUpdateTime(new Date());
|
||||
portMappingMapper.updateById(mappingDO);
|
||||
portToSecurityGroupMap.remove(mappingDO.getServerPort());
|
||||
|
||||
Reference in New Issue
Block a user