Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update audit plan sql meta api #2506

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqle/api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
v1ProjectRouter.PATCH("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/", v1.UpdateAuditPlanStatus)
v1ProjectRouter.GET("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sqls", v1.GetInstanceAuditPlanSQLs) // 弃用
v1ProjectRouter.GET("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sql_meta", v1.GetInstanceAuditPlanSQLMeta)
v1ProjectRouter.GET("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sql_data", v1.GetInstanceAuditPlanSQLData)
v1ProjectRouter.GET("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sql_export", v1.GetInstanceAuditPlanSQLData)
v1ProjectRouter.POST("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sql_data", v1.GetInstanceAuditPlanSQLData)
v1ProjectRouter.POST("/:project_name/instance_audit_plans/:instance_audit_plan_id/audit_plans/:audit_plan_type/sql_export", v1.GetInstanceAuditPlanSQLExport)

// sql manager
v1ProjectRouter.GET("/:project_name/sql_manages", v1.GetSqlManageList)
Expand Down
7 changes: 6 additions & 1 deletion sqle/api/controller/v1/instance_audit_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,11 @@ func GetInstanceAuditPlanSQLs(c echo.Context) error {
})
}

type GetAuditPlanSQLMetaResV1 struct {
controller.BaseRes
Data AuditPlanSQLMetaResV1 `json:"data"`
}

type AuditPlanSQLMetaResV1 struct {
Head []AuditPlanSQLHeadV1 `json:"head"`
FilterMetaList []FilterMeta `json:"filter_meta_list"`
Expand Down Expand Up @@ -929,7 +934,7 @@ type FilterBetweenValue struct {
// @Param project_name path string true "project name"
// @Param instance_audit_plan_id path string true "instance audit plan id"
// @Param audit_plan_type path string true "audit plan type"
// @Success 200 {object} v1.AuditPlanSQLMetaResV1
// @Success 200 {object} v1.GetAuditPlanSQLMetaResV1
// @router /v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_type}/sql_meta [get]
func GetInstanceAuditPlanSQLMeta(c echo.Context) error {
return nil
Expand Down
23 changes: 22 additions & 1 deletion sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ var doc = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.AuditPlanSQLMetaResV1"
"$ref": "#/definitions/v1.GetAuditPlanSQLMetaResV1"
}
}
}
Expand Down Expand Up @@ -10794,6 +10794,23 @@ var doc = `{
}
}
},
"v1.GetAuditPlanSQLMetaResV1": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 0
},
"data": {
"type": "object",
"$ref": "#/definitions/v1.AuditPlanSQLMetaResV1"
},
"message": {
"type": "string",
"example": "ok"
}
}
},
"v1.GetAuditPlanSQLsResV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -12372,6 +12389,10 @@ var doc = `{
"type": "string",
"example": "test"
},
"instance_id": {
"type": "string",
"example": "instance_id"
},
"instance_name": {
"type": "string",
"example": "test_mysql"
Expand Down
23 changes: 22 additions & 1 deletion sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.AuditPlanSQLMetaResV1"
"$ref": "#/definitions/v1.GetAuditPlanSQLMetaResV1"
}
}
}
Expand Down Expand Up @@ -10778,6 +10778,23 @@
}
}
},
"v1.GetAuditPlanSQLMetaResV1": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 0
},
"data": {
"type": "object",
"$ref": "#/definitions/v1.AuditPlanSQLMetaResV1"
},
"message": {
"type": "string",
"example": "ok"
}
}
},
"v1.GetAuditPlanSQLsResV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -12356,6 +12373,10 @@
"type": "string",
"example": "test"
},
"instance_id": {
"type": "string",
"example": "instance_id"
},
"instance_name": {
"type": "string",
"example": "test_mysql"
Expand Down
17 changes: 16 additions & 1 deletion sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,18 @@ definitions:
order_by:
type: string
type: object
v1.GetAuditPlanSQLMetaResV1:
properties:
code:
example: 0
type: integer
data:
$ref: '#/definitions/v1.AuditPlanSQLMetaResV1'
type: object
message:
example: ok
type: string
type: object
v1.GetAuditPlanSQLsResV1:
properties:
code:
Expand Down Expand Up @@ -2213,6 +2225,9 @@ definitions:
business:
example: test
type: string
instance_id:
example: instance_id
type: string
instance_name:
example: test_mysql
type: string
Expand Down Expand Up @@ -6364,7 +6379,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/v1.AuditPlanSQLMetaResV1'
$ref: '#/definitions/v1.GetAuditPlanSQLMetaResV1'
security:
- ApiKeyAuth: []
summary: 获取指定扫描任务的SQL列表元信息
Expand Down
Loading