|
@@ -158,13 +158,14 @@ func (s *globalLimitService) AddGlobalLimit(ctx context.Context, req v1.GlobalLi
|
|
|
var userId int64
|
|
|
var groupId int64
|
|
|
g.Go(func() error {
|
|
|
- gatewayGroupId, e := s.gateWayGroupRep.GetGatewayGroupWhereHostIdNull(gCtx, require.Operator, require.IpCount)
|
|
|
+ res, e := s.gateWayGroupRep.GetGatewayGroupWhereHostIdNull(gCtx, require.Operator, require.IpCount)
|
|
|
if e != nil {
|
|
|
return e
|
|
|
}
|
|
|
- if gatewayGroupId == 0 {
|
|
|
+ if res == 0 {
|
|
|
return fmt.Errorf("获取网关组失败")
|
|
|
}
|
|
|
+ gatewayGroupId = res
|
|
|
return nil
|
|
|
})
|
|
|
|
|
@@ -190,6 +191,7 @@ func (s *globalLimitService) AddGlobalLimit(ctx context.Context, req v1.GlobalLi
|
|
|
if res == 0 {
|
|
|
return fmt.Errorf("创建规则分组失败")
|
|
|
}
|
|
|
+ groupId = res
|
|
|
return nil
|
|
|
})
|
|
|
|
|
@@ -198,6 +200,7 @@ func (s *globalLimitService) AddGlobalLimit(ctx context.Context, req v1.GlobalLi
|
|
|
}
|
|
|
|
|
|
ruleId, err := s.cdnService.BindPlan(ctx, v1.Plan{
|
|
|
+ UserId: userId,
|
|
|
|
|
|
})
|
|
|
|