|
@@ -395,6 +395,18 @@ func (s *globalLimitService) EditGlobalLimit(ctx context.Context, req v1.GlobalL
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+
|
|
|
+ if data.GatewayGroupId == 0 {
|
|
|
+ gatewayGroupId, e := s.gateWayGroupRep.GetGatewayGroupWhereHostIdNull(ctx, require)
|
|
|
+ if e != nil {
|
|
|
+ return fmt.Errorf("获取网关组失败: %w", e)
|
|
|
+ }
|
|
|
+ if gatewayGroupId == 0 {
|
|
|
+ return fmt.Errorf("获取网关组失败")
|
|
|
+ }
|
|
|
+ data.GatewayGroupId = gatewayGroupId
|
|
|
+ }
|
|
|
+
|
|
|
outputTimeStr, err := s.ConversionTime(ctx, require.ExpiredAt)
|
|
|
if err != nil {
|
|
|
return err
|
|
@@ -418,6 +430,7 @@ func (s *globalLimitService) EditGlobalLimit(ctx context.Context, req v1.GlobalL
|
|
|
if err := s.globalLimitRepository.UpdateGlobalLimitByHostId(ctx, &model.GlobalLimit{
|
|
|
HostId: req.HostId,
|
|
|
Comment: req.Comment,
|
|
|
+ GatewayGroupId: data.GatewayGroupId,
|
|
|
ExpiredAt: expiredAt,
|
|
|
}); err != nil {
|
|
|
return err
|