|
@@ -3,6 +3,7 @@ package waf
|
|
|
import (
|
|
|
"context"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
v1 "github.com/go-nunu/nunu-layout-advanced/api/v1"
|
|
|
"github.com/go-nunu/nunu-layout-advanced/internal/model"
|
|
|
"github.com/go-nunu/nunu-layout-advanced/internal/repository/api/waf"
|
|
@@ -93,6 +94,14 @@ func (s *gatewayipService) GetGatewayipOnlyIpByHostIdAll(ctx context.Context, ho
|
|
|
}
|
|
|
|
|
|
if len(gatewayIps) == 0 {
|
|
|
+ expire, err := s.host.CheckExpired(ctx, uid, hostId)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if !expire {
|
|
|
+ return nil, fmt.Errorf("请续费该实例")
|
|
|
+ }
|
|
|
+
|
|
|
err = s.AddIpWhereHostIdNull(ctx, hostId,uid)
|
|
|
if err != nil {
|
|
|
return nil, err
|