|
@@ -94,6 +94,23 @@ func (s *gatewayIpAdminService) AddGatewayIp(ctx context.Context,req model.Gatew
|
|
|
}
|
|
|
|
|
|
func (s *gatewayIpAdminService) EditGatewayIp(ctx context.Context,req model.Gatewayip) error {
|
|
|
+ oldData, err := s.GetGatewayIpAdmin(ctx, int64(req.Id))
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if oldData.Ip != req.Ip || oldData.NodeArea != "" || req.NodeArea != "" {
|
|
|
+ // 启动网关组IP
|
|
|
+ err := s.sendIp(ctx,oldData.Ip,"deleteIp",oldData.NodeArea)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ err = s.sendIp(ctx,req.Ip,"addIp",req.NodeArea)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return s.gatewayIpAdminRepository.EditGatewayIp(ctx,req)
|
|
|
}
|
|
|
|