add: ws for custom kpi

This commit is contained in:
2024-08-09 19:53:36 +08:00
parent 4f57ffd9a5
commit caaa4abfb6
2 changed files with 7 additions and 1 deletions

View File

@@ -307,15 +307,19 @@ func PostKPIReportFromNF(w http.ResponseWriter, r *http.Request) {
report.KpiValues = append(report.KpiValues, *kpiCVal)
}
// KPI自定义指标入库
kpi_c_report.InsertKpiCReport(kpiData.NEType, report)
// 发送到匹配的网元
neInfo := neService.NewNeInfoImpl.SelectNeInfoByRmuid(kpiData.RmUid)
if neInfo.RmUID == kpiData.RmUid {
// 推送到ws订阅组
wsService.NewWSSendImpl.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI, neInfo.NeType, neInfo.NeId), kpiEvent)
// 推送自定义KPI到ws订阅组
wsService.NewWSSendImpl.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI_C, neInfo.NeType, neInfo.NeId), report)
if neInfo.NeType == "UPF" {
// 推送标识为12_RMUID, exp: 12_4400HXUPF001
wsService.NewWSSendImpl.ByGroupID(wsService.GROUP_KPI_UPF+"_"+kpiReport.Task.NE.RmUID, kpiEvent)
wsService.NewWSSendImpl.ByGroupID(wsService.GROUP_KPI_UPF+kpiReport.Task.NE.RmUID, kpiEvent)
}
}