|
@@ -234,7 +234,7 @@ func (s *tcpforwardingService) AddTcpForwarding(ctx context.Context, req *v1.Tcp
|
|
|
}
|
|
|
|
|
|
func (s *tcpforwardingService) EditTcpForwarding(ctx context.Context, req *v1.TcpForwardingRequest) error {
|
|
|
- WafTcpId, err := s.tcpforwardingRepository.GetTcpforwardingWafTcpIdById(ctx, req.Id)
|
|
|
+ WafTcpId, err := s.tcpforwardingRepository.GetTcpforwardingWafTcpIdById(ctx, req.TcpForwardingData.Id)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -243,17 +243,16 @@ func (s *tcpforwardingService) EditTcpForwarding(ctx context.Context, req *v1.Tc
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
-
|
|
|
_, err = s.wafformatter.sendFormData(ctx, "admin/info/waf_tcp/edit?&__goadmin_edit_pk="+strconv.Itoa(req.TcpForwardingData.WafTcpId), "admin/edit/waf_tcp", formData)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
tcpModel := s.buildTcpForwardingModel(&req.TcpForwardingData, req.TcpForwardingData.WafTcpId, require)
|
|
|
- tcpModel.Id = req.Id
|
|
|
+ tcpModel.Id = req.TcpForwardingData.Id
|
|
|
if err = s.tcpforwardingRepository.EditTcpforwarding(ctx, tcpModel); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- TcpRuleModel := s.buildTcpRuleModel(&req.TcpForwardingData, require, req.Id)
|
|
|
+ TcpRuleModel := s.buildTcpRuleModel(&req.TcpForwardingData, require, req.TcpForwardingData.Id)
|
|
|
if err = s.tcpforwardingRepository.EditTcpforwardingIps(ctx, *TcpRuleModel); err != nil {
|
|
|
return err
|
|
|
}
|