From 0f97177f258c67397b206b70e5aea2b24a4868c1 Mon Sep 17 00:00:00 2001
From: qixiaoning <jony.kee@outlook.com>
Date: 星期五, 22 八月 2025 09:18:13 +0800
Subject: [PATCH] 移除panic
---
chanmanage-service/controllers/pollSet.go | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/chanmanage-service/controllers/pollSet.go b/chanmanage-service/controllers/pollSet.go
index 49488b2..275584e 100644
--- a/chanmanage-service/controllers/pollSet.go
+++ b/chanmanage-service/controllers/pollSet.go
@@ -282,7 +282,19 @@
// }
var ids []string = []string{}
ids = append(ids, cE.Id)
- cri.AllTasks, _ = models.GetListTask(ids)
+ tasks, _ := models.GetListTask(ids)
+ //rules
+ ruleMap := models.GetAllRule()
+
+ cri.AllTasks = []commonModel.TaskM{}
+ for _, item := range tasks {
+ temp := &commonModel.TaskM{
+ TaskName: item.TaskName,
+ EventName: item.EventName,
+ TaskDescription: ruleMap[item.TaskId],
+ }
+ cri.AllTasks = append(cri.AllTasks, *temp)
+ }
//澶勭悊鎽勫儚鏈虹殑鐘舵��
if cE.RunType == commonModel.TYPE_RUNTYPE_POLL || cE.RunType == commonModel.TYPE_RUNTYPE_REALTIME {
--
Gitblit v1.8.0