Skip to content

Commit

Permalink
Merge pull request #1891 from actiontech/change-to-list-api
Browse files Browse the repository at this point in the history
feat:support redirect to sql_audit list
  • Loading branch information
ColdWaterLW authored Oct 8, 2023
2 parents 6141e33 + c68c48b commit 44d2f2c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 16 deletions.
16 changes: 9 additions & 7 deletions sqle/api/controller/v1/sql_audit_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,14 @@ func UpdateSQLAuditRecordV1(c echo.Context) error {
}

type GetSQLAuditRecordsReqV1 struct {
FuzzySearchTags string `json:"fuzzy_search_tags" query:"fuzzy_search_tags"` // todo issue1811
FilterSQLAuditStatus string `json:"filter_sql_audit_status" query:"filter_sql_audit_status" enums:"auditing,successfully,"`
FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"`
FilterCreateTimeFrom string `json:"filter_create_time_from" query:"filter_create_time_from"`
FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"`
PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
PageSize uint32 `json:"page_size" query:"page_size" valid:"required"`
FuzzySearchTags string `json:"fuzzy_search_tags" query:"fuzzy_search_tags"` // todo issue1811
FilterSQLAuditStatus string `json:"filter_sql_audit_status" query:"filter_sql_audit_status" enums:"auditing,successfully,"`
FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"`
FilterCreateTimeFrom string `json:"filter_create_time_from" query:"filter_create_time_from"`
FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"`
FilterSqlAuditRecordIDs []string `json:"filter_sql_audit_record_ids" query:"filter_sql_audit_record_ids"`
PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
PageSize uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type SQLAuditRecord struct {
Expand Down Expand Up @@ -525,6 +526,7 @@ const (
// @Param filter_instance_name query string false "filter instance name"
// @Param filter_create_time_from query string false "filter create time from"
// @Param filter_create_time_to query string false "filter create time to"
// @Param filter_sql_audit_record_ids query []string false "filter sql audit record ids"
// @Param page_index query uint32 true "page index"
// @Param page_size query uint32 true "size of per page"
// @Param project_name path string true "project name"
Expand Down
6 changes: 3 additions & 3 deletions sqle/api/controller/v1/sql_manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ type AuditResult struct {
}

type Source struct {
Type string `json:"type" enums:"audit_plan,sql_audit_record"`
AuditPlanName string `json:"audit_plan_name"`
SqlAuditRecordId string `json:"sql_audit_record_id"`
Type string `json:"type" enums:"audit_plan,sql_audit_record"`
AuditPlanName string `json:"audit_plan_name"`
SqlAuditRecordIds []string `json:"sql_audit_record_ids"`
}

// GetSqlManageList
Expand Down
16 changes: 14 additions & 2 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4406,6 +4406,15 @@ var doc = `{
"name": "filter_create_time_to",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"description": "filter sql audit record ids",
"name": "filter_sql_audit_record_ids",
"in": "query"
},
{
"type": "integer",
"description": "page index",
Expand Down Expand Up @@ -14492,8 +14501,11 @@ var doc = `{
"audit_plan_name": {
"type": "string"
},
"sql_audit_record_id": {
"type": "string"
"sql_audit_record_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
Expand Down
16 changes: 14 additions & 2 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4390,6 +4390,15 @@
"name": "filter_create_time_to",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"description": "filter sql audit record ids",
"name": "filter_sql_audit_record_ids",
"in": "query"
},
{
"type": "integer",
"description": "page index",
Expand Down Expand Up @@ -14476,8 +14485,11 @@
"audit_plan_name": {
"type": "string"
},
"sql_audit_record_id": {
"type": "string"
"sql_audit_record_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
Expand Down
12 changes: 10 additions & 2 deletions sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3213,8 +3213,10 @@ definitions:
properties:
audit_plan_name:
type: string
sql_audit_record_id:
type: string
sql_audit_record_ids:
items:
type: string
type: array
type:
enum:
- audit_plan
Expand Down Expand Up @@ -7742,6 +7744,12 @@ paths:
in: query
name: filter_create_time_to
type: string
- description: filter sql audit record ids
in: query
items:
type: string
name: filter_sql_audit_record_ids
type: array
- description: page index
in: query
name: page_index
Expand Down

0 comments on commit 44d2f2c

Please sign in to comment.