Quellcode durchsuchen

fix(aodun): 修复 IP 黑白名单接口参数错误- 将 getWhiteStaticList 请求中的 "ids" 字段更改为 "ip"
- 重新启用 DelWhiteStaticList 方法,修复了之前被注释掉的代码
-

fusu vor 1 Monat
Ursprung
Commit
debf0be44f
2 geänderte Dateien mit 5 neuen und 6 gelöschten Zeilen
  1. 4 5
      internal/job/whitelist.go
  2. 1 1
      internal/service/aodun.go

+ 4 - 5
internal/job/whitelist.go

@@ -4,11 +4,11 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
-	"github.com/davecgh/go-spew/spew"
 	"github.com/go-nunu/nunu-layout-advanced/internal/service"
 	"github.com/google/uuid"
 	"github.com/rabbitmq/amqp091-go"
 	"go.uber.org/zap"
+	"strconv"
 	"strings"
 	"sync"
 )
@@ -222,10 +222,9 @@ func (j *whitelistJob) handleIpMessage(ctx context.Context, logger *zap.Logger,
 				errChan <- fmt.Errorf("获取IP '%s' (isSmall: %t) ID失败: %w", ip, isSmall, err)
 				return
 			}
-			spew.Dump(id,"----------------------------")
-			//if err := j.aoDunService.DelWhiteStaticList(ctx, isSmall, strconv.Itoa(id)); err != nil {
-			//	errChan <- fmt.Errorf("删除IP '%s' (isSmall: %t, id: %d) 失败: %w", ip, isSmall, id, err)
-			//}
+			if err := j.aoDunService.DelWhiteStaticList(ctx, isSmall, strconv.Itoa(id)); err != nil {
+				errChan <- fmt.Errorf("删除IP '%s' (isSmall: %t, id: %d) 失败: %w", ip, isSmall, id, err)
+			}
 		}
 
 		for _, ip := range payload.Ips {

+ 1 - 1
internal/service/aodun.go

@@ -198,7 +198,7 @@ func (s *aoDunService) GetWhiteStaticList(ctx context.Context, isSmall bool, ip
 		"action": "get",
 		"bwflag": "white",
 		"page":   1,
-		"ids":    ip,
+		"ip":    ip,
 	}
 
 	var res v1.IpGetResponse