Skip to content

Commit

Permalink
db_type is needed when get rules by audit result
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdWaterLW committed Oct 11, 2023
1 parent 7ce0e7d commit 5b793a8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqle/api/controller/v2/audit_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func GetAuditPlanReportSQLs(c echo.Context) error {
Level: ar.Level,
Message: ar.Message,
RuleName: ar.RuleName,
DbType: ap.DBType,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions sqle/api/controller/v2/sql_audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func convertTaskResultToAuditResV2(task *model.Task) *AuditResDataV2 {
Level: sql.AuditResults[j].Level,
Message: sql.AuditResults[j].Message,
RuleName: sql.AuditResults[j].RuleName,
DbType: task.DBType,
}
}

Expand Down
2 changes: 2 additions & 0 deletions sqle/api/controller/v2/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type AuditResult struct {
Level string `json:"level" example:"warn"`
Message string `json:"message" example:"避免使用不必要的内置函数md5()"`
RuleName string `json:"rule_name"`
DbType string `json:"db_type"`
}

// @Summary 获取指定扫描任务的SQLs信息
Expand Down Expand Up @@ -114,6 +115,7 @@ func GetTaskSQLs(c echo.Context) error {
Level: ar.Level,
Message: ar.Message,
RuleName: ar.RuleName,
DbType: task.DBType,
})
}

Expand Down
3 changes: 3 additions & 0 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16377,6 +16377,9 @@ var doc = `{
"v2.AuditResult": {
"type": "object",
"properties": {
"db_type": {
"type": "string"
},
"level": {
"type": "string",
"example": "warn"
Expand Down
3 changes: 3 additions & 0 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -16361,6 +16361,9 @@
"v2.AuditResult": {
"type": "object",
"properties": {
"db_type": {
"type": "string"
},
"level": {
"type": "string",
"example": "warn"
Expand Down
2 changes: 2 additions & 0 deletions sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4421,6 +4421,8 @@ definitions:
type: object
v2.AuditResult:
properties:
db_type:
type: string
level:
example: warn
type: string
Expand Down

0 comments on commit 5b793a8

Please sign in to comment.