Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
02ac331c
Commit
02ac331c
authored
Jul 05, 2023
by
李科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 完善预警规则设置列表返回
parent
2b39353a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
src/bean/vo/response/alert_rules.go
src/bean/vo/response/alert_rules.go
+1
-0
src/service/alert_rules.go
src/service/alert_rules.go
+1
-1
No files found.
src/bean/vo/response/alert_rules.go
View file @
02ac331c
...
@@ -4,6 +4,7 @@ import "gitlab.wodcloud.com/smart-operation/so-operation-api/src/bean/entity"
...
@@ -4,6 +4,7 @@ import "gitlab.wodcloud.com/smart-operation/so-operation-api/src/bean/entity"
type
AlertRulesItem
struct
{
type
AlertRulesItem
struct
{
entity
.
AlertRules
`xorm:"extends"`
entity
.
AlertRules
`xorm:"extends"`
AlertRuleType
string
`json:"alert_rule_type" xorm:"alert_rule_type"`
// 预警规则类型 关联字典表
ClassParentName
string
`json:"class_parent_name" xorm:"class_parent_name"`
ClassParentName
string
`json:"class_parent_name" xorm:"class_parent_name"`
ClassName
string
`json:"class_name" xorm:"class_name"`
ClassName
string
`json:"class_name" xorm:"class_name"`
MetricConfigName
string
`json:"metric_config_name" xorm:"metric_config_name"`
MetricConfigName
string
`json:"metric_config_name" xorm:"metric_config_name"`
...
...
src/service/alert_rules.go
View file @
02ac331c
...
@@ -213,7 +213,7 @@ func (a *AlertRulesSvc) List(req request.ListAlertRules) (resp response.AlertRul
...
@@ -213,7 +213,7 @@ func (a *AlertRulesSvc) List(req request.ListAlertRules) (resp response.AlertRul
}
}
session
:=
db
.
NewSession
()
session
:=
db
.
NewSession
()
defer
session
.
Close
()
defer
session
.
Close
()
session
.
Table
(
new
(
entity
.
AlertRules
))
.
Alias
(
"r"
)
.
Select
(
"r.*,acp.class_name class_parent_name,ac.class_name,mc.metric_name metric_config_name"
)
session
.
Table
(
new
(
entity
.
AlertRules
))
.
Alias
(
"r"
)
.
Select
(
"r.*,acp.class_name class_parent_name,ac.class_name,mc.metric_name metric_config_name
,mc.alert_rule_type
"
)
session
.
Join
(
"LEFT"
,
"metric_config mc"
,
"mc.id = r.metric_config_id"
)
session
.
Join
(
"LEFT"
,
"metric_config mc"
,
"mc.id = r.metric_config_id"
)
session
.
Join
(
"LEFT"
,
"alert_class ac"
,
"ac.class_id = r.class_id"
)
session
.
Join
(
"LEFT"
,
"alert_class ac"
,
"ac.class_id = r.class_id"
)
session
.
Join
(
"LEFT"
,
"alert_class acp"
,
"acp.class_id = ac.parent_id"
)
session
.
Join
(
"LEFT"
,
"alert_class acp"
,
"acp.class_id = ac.parent_id"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment