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
159e45b0
Commit
159e45b0
authored
Jul 07, 2023
by
李科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改预警总览展示字段
parent
738f22d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
79 deletions
+44
-79
src/bean/entity/alert_overview.go
src/bean/entity/alert_overview.go
+16
-11
src/bean/vo/response/alert_overview.go
src/bean/vo/response/alert_overview.go
+5
-5
src/service/alert_overview.go
src/service/alert_overview.go
+23
-63
No files found.
src/bean/entity/alert_overview.go
View file @
159e45b0
...
...
@@ -23,25 +23,30 @@ type AlertArray struct {
type
RiskLevelDistribution
struct
{
Name
string
`json:"name"`
// 名称
RiskLevel
int
`json:"risk_level"`
// 风险等级,1:低风险,2:一般风险,3:较大风险,4:重大风险
Percentage
string
`json:"percentage"`
// 百分比
//RiskLevel int `json:"risk_level"` // 风险等级,1:低风险,2:一般风险,3:较大风险,4:重大风险
//Percentage string `json:"percentage"` // 百分比
Value
int
`json:"value"`
}
type
AlertStatusDistribution
struct
{
Name
string
`json:"name"`
// 名称
Status
int
`json:"status"`
// 状态,1:已恢复 2:未恢复 3:已关闭
Percentage
string
`json:"percentage"`
// 百分比
//Status int `json:"status"` // 状态,1:已恢复 2:未恢复 3:已关闭
//Percentage string `json:"percentage"` // 百分比
Value
int
`json:"value"`
}
type
AlertClassDistribution
struct
{
Name
string
`json:"name"`
// 名称
ClassId
int
`json:"class_id"`
// 预警分类id
Percentage
string
`json:"percentage"`
// 百分比
//ClassId int `json:"class_id"` // 预警分类id
//Percentage string `json:"percentage"` // 百分比
Value
int
`json:"value"`
}
type
AlertFrequencyDistribution
struct
{
Name
string
`json:"name"`
// 名称
Count
int
`json:"count"`
// 数量
//Name string `json:"name"` // 名称
//Value int `json:"count"` // 数量
XAxis
[]
string
`json:"xAxis"`
Data
[]
int
`json:"data"`
}
func
(
a
*
AlertOverview
)
TableName
()
string
{
...
...
src/bean/vo/response/alert_overview.go
View file @
159e45b0
...
...
@@ -9,7 +9,7 @@ type AlertOverviewItem struct {
RiskLevelDistribution
[]
entity
.
RiskLevelDistribution
`json:"risk_level_distribution"`
AlertStatusDistribution
[]
entity
.
AlertStatusDistribution
`json:"alert_status_distribution"`
AlertClassDistribution
[]
entity
.
AlertClassDistribution
`json:"alert_class_distribution"`
AlertFrequencyDistribution
[]
entity
.
AlertFrequencyDistribution
`json:"alert_frequency_distribution"`
AlertFrequencyDistribution
entity
.
AlertFrequencyDistribution
`json:"alert_frequency_distribution"`
}
type
AlertOverviewList
struct
{
...
...
src/service/alert_overview.go
View file @
159e45b0
...
...
@@ -188,92 +188,52 @@ func (a *AlertOverviewSvc) Overview(req request.DetailAlertOverview) (resp respo
RiskLevelDistribution
:
[]
entity
.
RiskLevelDistribution
{
{
Name
:
"重大风险"
,
RiskLevel
:
4
,
Percentage
:
"10%"
,
Value
:
1
,
},
{
Name
:
"较大风险"
,
RiskLevel
:
3
,
Percentage
:
"20%"
,
Value
:
2
,
},
{
Name
:
"一般风险"
,
RiskLevel
:
2
,
Percentage
:
"30%"
,
Value
:
3
,
},
{
Name
:
"低风险"
,
RiskLevel
:
1
,
Percentage
:
"40%"
,
Value
:
4
,
},
},
AlertStatusDistribution
:
[]
entity
.
AlertStatusDistribution
{
{
Name
:
"未恢复"
,
Status
:
1
,
Percentage
:
"30%"
,
Value
:
4
,
},
{
Name
:
"已恢复"
,
Status
:
2
,
Percentage
:
"70%"
,
Value
:
6
,
},
},
AlertClassDistribution
:
[]
entity
.
AlertClassDistribution
{
{
Name
:
"容器集群"
,
ClassId
:
1
,
Percentage
:
"30%"
,
Value
:
1
,
},
{
Name
:
"容器节点"
,
ClassId
:
2
,
Percentage
:
"20%"
,
Value
:
2
,
},
{
Name
:
"容器组"
,
ClassId
:
3
,
Percentage
:
"30%"
,
Value
:
3
,
},
{
Name
:
"网关"
,
ClassId
:
4
,
Percentage
:
"20%"
,
},
},
AlertFrequencyDistribution
:
[]
entity
.
AlertFrequencyDistribution
{
{
Name
:
"0-3时"
,
Count
:
12
,
},
{
Name
:
"3-6时"
,
Count
:
20
,
},
{
Name
:
"6-9时"
,
Count
:
11
,
},
{
Name
:
"9-12时"
,
Count
:
50
,
},
{
Name
:
"12-15时"
,
Count
:
60
,
Value
:
4
,
},
{
Name
:
"15-18时"
,
Count
:
30
,
},
{
Name
:
"18-21时"
,
Count
:
16
,
},
{
Name
:
"21-24时"
,
Count
:
6
,
},
AlertFrequencyDistribution
:
entity
.
AlertFrequencyDistribution
{
XAxis
:
[]
string
{
"0-3时"
,
"3-6时"
,
"6-9时"
,
"9-12时"
,
"12-15时"
,
"15-18时"
,
"18-21时"
,
"21-24时"
},
Data
:
[]
int
{
12
,
20
,
11
,
50
,
60
,
30
,
16
,
6
},
},
}
...
...
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