From c4ae4a773b6c037965b57f243d979a2bfd100a3c Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Fri, 22 Nov 2024 10:39:31 +0800 Subject: [PATCH 1/2] api definition: add status to associated rollback workflow --- sqle/api/controller/v2/task.go | 1 + sqle/docs/docs.go | 12 ++++++++++++ sqle/docs/swagger.json | 12 ++++++++++++ sqle/docs/swagger.yaml | 10 ++++++++++ 4 files changed, 35 insertions(+) diff --git a/sqle/api/controller/v2/task.go b/sqle/api/controller/v2/task.go index bc7888a5d..80cb64861 100644 --- a/sqle/api/controller/v2/task.go +++ b/sqle/api/controller/v2/task.go @@ -49,6 +49,7 @@ type AuditTaskSQLResV2 struct { type AssociatedRollbackWorkflow struct { WorkflowID string `json:"workflow_id"` WorkflowName string `json:"workflow_name"` + Status string `json:"status" enums:"wait_for_audit,wait_for_execution,rejected,canceled,exec_failed,executing,finished"` } type AuditResult struct { diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 5f9a1b6c8..fbf022e86 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -18513,6 +18513,18 @@ var doc = `{ "v2.AssociatedRollbackWorkflow": { "type": "object", "properties": { + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, "workflow_id": { "type": "string" }, diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index d45f83750..1058e22ea 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -18497,6 +18497,18 @@ "v2.AssociatedRollbackWorkflow": { "type": "object", "properties": { + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, "workflow_id": { "type": "string" }, diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index 00382ae4d..539569509 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -5080,6 +5080,16 @@ definitions: type: object v2.AssociatedRollbackWorkflow: properties: + status: + enum: + - wait_for_audit + - wait_for_execution + - rejected + - canceled + - exec_failed + - executing + - finished + type: string workflow_id: type: string workflow_name: From 668d8c90ae19f06195bac9389dc5f7f97d062074 Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Fri, 22 Nov 2024 10:55:45 +0800 Subject: [PATCH 2/2] rename: origin to original --- sqle/api/controller/v1/backup.go | 6 +++--- sqle/api/controller/v2/task.go | 2 +- sqle/docs/docs.go | 8 ++++---- sqle/docs/swagger.json | 8 ++++---- sqle/docs/swagger.yaml | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sqle/api/controller/v1/backup.go b/sqle/api/controller/v1/backup.go index 2217ca189..41a57a7ca 100644 --- a/sqle/api/controller/v1/backup.go +++ b/sqle/api/controller/v1/backup.go @@ -6,7 +6,7 @@ import ( ) type UpdateSqlBackupStrategyReq struct { - Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"` + Strategy string `json:"strategy" enums:"none,manual,reverse_sql,original_row"` } // UpdateSqlBackupStrategy @@ -27,7 +27,7 @@ func UpdateSqlBackupStrategy(c echo.Context) error { } type UpdateTaskBackupStrategyReq struct { - Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"` + Strategy string `json:"strategy" enums:"none,manual,reverse_sql,original_row"` } // UpdateTaskBackupStrategy @@ -73,7 +73,7 @@ type BackupSqlData struct { OriginSQL string `json:"origin_sql"` OriginTaskId uint `json:"origin_task_id"` BackupSqls []string `json:"backup_sqls"` - BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"` + BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,original_row"` InstanceName string `json:"instance_name"` InstanceId string `json:"instance_id"` ExecStatus string `json:"exec_status"` diff --git a/sqle/api/controller/v2/task.go b/sqle/api/controller/v2/task.go index 80cb64861..a0a1f1d66 100644 --- a/sqle/api/controller/v2/task.go +++ b/sqle/api/controller/v2/task.go @@ -41,7 +41,7 @@ type AuditTaskSQLResV2 struct { RollbackSQLs []string `json:"rollback_sqls,omitempty"` Description string `json:"description"` SQLType string `json:"sql_type"` - BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"` + BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,original_row"` BackupStrategyTip string `json:"backup_strategy_tip"` AssociatedRollbackWorkflows []*AssociatedRollbackWorkflow `json:"associated_rollback_workflows"` } diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index fbf022e86..75fa816f4 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -11797,7 +11797,7 @@ var doc = `{ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] }, "description": { @@ -17595,7 +17595,7 @@ var doc = `{ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] } } @@ -17684,7 +17684,7 @@ var doc = `{ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] } } @@ -18822,7 +18822,7 @@ var doc = `{ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] }, "backup_strategy_tip": { diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 1058e22ea..5a09e5f0e 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -11781,7 +11781,7 @@ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] }, "description": { @@ -17579,7 +17579,7 @@ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] } } @@ -17668,7 +17668,7 @@ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] } } @@ -18806,7 +18806,7 @@ "none", "manual", "reverse_sql", - "origin_row" + "original_row" ] }, "backup_strategy_tip": { diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index 539569509..caae43074 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -497,7 +497,7 @@ definitions: - none - manual - reverse_sql - - origin_row + - original_row type: string description: type: string @@ -4452,7 +4452,7 @@ definitions: - none - manual - reverse_sql - - origin_row + - original_row type: string type: object v1.UpdateSqlFileOrderV1Req: @@ -4512,7 +4512,7 @@ definitions: - none - manual - reverse_sql - - origin_row + - original_row type: string type: object v1.UpdateWechatConfigurationReqV1: @@ -5297,7 +5297,7 @@ definitions: - none - manual - reverse_sql - - origin_row + - original_row type: string backup_strategy_tip: type: string