refactor: remove processor logic

master
710leo 4 years ago
parent 7c2f49146d
commit 0cc4d85b37

@ -4,20 +4,18 @@ import (
"encoding/json" "encoding/json"
"strings" "strings"
//"github.com/didi/nightingale/v5/vos"
"github.com/toolkits/pkg/logger" "github.com/toolkits/pkg/logger"
"xorm.io/builder" "xorm.io/builder"
) )
type HistoryAlertEvent struct { type HistoryAlertEvent struct {
Id int64 `json:"id"` Id int64 `json:"id"`
RuleId int64 `json:"rule_id"` RuleId int64 `json:"rule_id"`
RuleName string `json:"rule_name"` RuleName string `json:"rule_name"`
RuleNote string `json:"rule_note"` RuleNote string `json:"rule_note"`
ProcessorUid int64 `json:"processor_uid"` //ProcessorUid int64 `json:"processor_uid"`
ProcessorObj User `json:"processor_user_objs" xorm:"-"` //ProcessorObj User `json:"processor_user_objs" xorm:""`
EventNote string `json:"event_note"` //EventNote string `json:"event_note"`
HashId string `json:"hash_id"` // 唯一标识 HashId string `json:"hash_id"` // 唯一标识
IsPromePull int `json:"is_prome_pull"` // 代表是否是prometheus pull告警为1时前端使用 ReadableExpression 拉取最近1小时数据 IsPromePull int `json:"is_prome_pull"` // 代表是否是prometheus pull告警为1时前端使用 ReadableExpression 拉取最近1小时数据
ResClasspaths string `json:"res_classpaths"` ResClasspaths string `json:"res_classpaths"`
@ -82,13 +80,15 @@ func (hae *HistoryAlertEvent) FillObjs() error {
hae.NotifyUserObjs = users hae.NotifyUserObjs = users
} }
if hae.ProcessorUid != 0 { /*
processor, err := UserGetById(hae.ProcessorUid) if hae.ProcessorUid != 0 {
if err != nil { processor, err := UserGetById(hae.ProcessorUid)
return err if err != nil {
return err
}
hae.ProcessorObj = *processor
} }
hae.ProcessorObj = *processor */
}
return nil return nil
} }

Loading…
Cancel
Save