提交 270d3b7e 编写于 作者: U UlricQin

code refactor

上级 4e3f9914
......@@ -17,12 +17,12 @@ func alertSubscribeGets(c *gin.Context) {
if err == nil {
ugcache := make(map[int64]*models.UserGroup)
for i := 0; i < len(lst); i++ {
lst[i].FillUserGroups(ugcache)
ginx.Dangerous(lst[i].FillUserGroups(ugcache))
}
rulecache := make(map[int64]string)
for i := 0; i < len(lst); i++ {
lst[i].FillRuleName(rulecache)
ginx.Dangerous(lst[i].FillRuleName(rulecache))
}
}
ginx.NewRender(c).Data(lst, err)
......@@ -40,10 +40,10 @@ func alertSubscribeGet(c *gin.Context) {
}
ugcache := make(map[int64]*models.UserGroup)
sub.FillUserGroups(ugcache)
ginx.Dangerous(sub.FillUserGroups(ugcache))
rulecache := make(map[int64]string)
sub.FillRuleName(rulecache)
ginx.Dangerous(sub.FillRuleName(rulecache))
ginx.NewRender(c).Data(sub, nil)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册