|
@@ -365,17 +365,31 @@ func (s *wafLogService) convertRawDataToExportResults(ctx context.Context, rawDa
|
|
|
|
|
|
// --- 网关 IP 处理 ---
|
|
|
var exposeAddr []string
|
|
|
- // 直接使用查询结果中附带的 gateway_ip_data
|
|
|
if len(v.GatewayIpData) > 0 && string(v.GatewayIpData) != "null" {
|
|
|
var gateWayIps []string
|
|
|
- // 解析从数据库子查询得到的JSON数据
|
|
|
- if err := json.Unmarshal(v.GatewayIpData, &gateWayIps); err == nil && len(gateWayIps) > 0 && cleanedData.Port != "" {
|
|
|
- for _, ip := range gateWayIps {
|
|
|
- exposeAddr = append(exposeAddr, ip+":"+cleanedData.Port)
|
|
|
+
|
|
|
+ if err := json.Unmarshal(v.GatewayIpData, &gateWayIps); err == nil && len(gateWayIps) > 0 {
|
|
|
+
|
|
|
+ if v.ApiName == "分配网关组" {
|
|
|
+ exposeAddr = append(exposeAddr, gateWayIps...)
|
|
|
+ } else if cleanedData.Port != "" {
|
|
|
+ for _, ip := range gateWayIps {
|
|
|
+ exposeAddr = append(exposeAddr, ip+":"+cleanedData.Port)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if strings.Contains( v.ApiName,"黑白") {
|
|
|
+ if cleanedData.AllowOrDeny == 1 {
|
|
|
+ cleanedData.Comment += " 白名单"
|
|
|
+ } else {
|
|
|
+ cleanedData.Comment += " 黑名单"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
var ruleIds []int64
|
|
|
if len(cleanedData.RuleID) > 0 {
|
|
|
ruleIds = cleanedData.RuleID
|