Parcourir la source

fix(internal/service): 修复删除转发规则时未传入 Uid 和 HostId

- 在删除 UDP转发和 WEB 转发时,增加了 Uid 和 HostId 参数
- 这些参数是从请求中获取,并传递给对应的删除方法
- 此修改确保了在删除转发规则时能够正确关联到用户和主机
fusu il y a 3 semaines
Parent
commit
a122006a9c
1 fichiers modifiés avec 10 ajouts et 2 suppressions
  1. 10 2
      internal/service/globallimit.go

+ 10 - 2
internal/service/globallimit.go

@@ -479,7 +479,11 @@ func (s *globalLimitService) DeleteGlobalLimit(ctx context.Context, req v1.Globa
 	})
 
 	g.Go(func() error {
-		e := s.udpForWarding.DeleteUdpForwarding(ctx,udpIds)
+		e := s.udpForWarding.DeleteUdpForwarding(ctx, v1.DeleteUdpForwardingRequest{
+			Ids: udpIds,
+			Uid: req.Uid,
+			HostId: req.HostId,
+		})
 		if e != nil {
 			return fmt.Errorf("删除UDP转发失败: %w", e)
 		}
@@ -487,7 +491,11 @@ func (s *globalLimitService) DeleteGlobalLimit(ctx context.Context, req v1.Globa
 	})
 
 	g.Go(func() error {
-		e := s.webForWarding.DeleteWebForwarding(ctx,webIds)
+		e := s.webForWarding.DeleteWebForwarding(ctx,v1.DeleteWebForwardingRequest{
+			Ids: webIds,
+			Uid: req.Uid,
+			HostId: req.HostId,
+		})
 		if e != nil {
 			return fmt.Errorf("删除WEB转发失败: %w", e)
 		}