ソースを参照

fix(cciplist): 修复 IP 黑白名单获取问题

- 在 GetCcIpList 方法中添加 state 条件,仅获取状态为 1 的记录
-此修改确保只返回有效的 IP黑白名单,提高数据准确性
fusu 2 週間 前
コミット
7ed415a9de
1 ファイル変更1 行追加1 行削除
  1. 1 1
      internal/repository/api/flexCdn/cciplist.go

+ 1 - 1
internal/repository/api/flexCdn/cciplist.go

@@ -33,7 +33,7 @@ func (r *ccIpListRepository) GetCcIpList(ctx context.Context, serverId int64) ([
 	if err != nil {
 		return nil, err
 	}
-	return req, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND sourceCategory = ?", ipListId, "cc").Order("id desc").Select("value,type, reason").Scan(&req).Error
+	return req, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND sourceCategory = ? AND state = ?", ipListId, "cc", 1).Order("id desc").Select("value,type, reason").Scan(&req).Error
 }
 
 func (r *ccIpListRepository) GetHttpWebId(ctx context.Context, serverId int64) (int64, error) {