diff --git a/sqle/api/controller/v1/backup.go b/sqle/api/controller/v1/backup.go index 219ecaf77..4d382fbac 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" enum:"none,manual,reverse_sql,origin_row"` + Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"` } // UpdateSqlBackupStrategy @@ -27,7 +27,7 @@ func UpdateSqlBackupStrategy(c echo.Context) error { } type UpdateTaskBackupStrategyReq struct { - Strategy string `json:"strategy" enum:"none,manual,reverse_sql,origin_row"` + Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"` } // UpdateTaskBackupStrategy @@ -72,9 +72,9 @@ type BackupSqlData struct { ExecSqlID uint `json:"exec_sql_id"` OriginSQL string `json:"origin_sql"` BackupSqls []string `json:"backup_sqls"` - BackupStrategy string `json:"backup_strategy" enum:"none,manual,reverse_sql,origin_row"` + BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"` InstanceName string `json:"instance_name"` - InstanceId string `json:"instance_id "` + InstanceId string `json:"instance_id"` ExecStatus string `json:"exec_status"` Description string `json:"description"` } diff --git a/sqle/api/controller/v2/task.go b/sqle/api/controller/v2/task.go index 40392f31e..e0aff0422 100644 --- a/sqle/api/controller/v2/task.go +++ b/sqle/api/controller/v2/task.go @@ -41,7 +41,7 @@ type AuditTaskSQLResV2 struct { RollbackSQL string `json:"rollback_sql,omitempty"` Description string `json:"description"` SQLType string `json:"sql_type"` - BackupStrategy string `json:"backup_strategy" enum:"none,manual,reverse_sql,origin_row"` + BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"` BackupStrategyTip string `json:"backup_strategy_tip"` AssociatedWorkflowIds []string `json:"associate_workflow_ids"` } diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 867236be6..b63e57282 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -11781,7 +11781,13 @@ var doc = `{ } }, "backup_strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] }, "description": { "type": "string" @@ -11795,7 +11801,7 @@ var doc = `{ "exec_status": { "type": "string" }, - "instance_id ": { + "instance_id": { "type": "string" }, "instance_name": { @@ -17549,7 +17555,13 @@ var doc = `{ "type": "object", "properties": { "strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] } } }, @@ -17632,7 +17644,13 @@ var doc = `{ "type": "object", "properties": { "strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] } } }, @@ -18741,7 +18759,13 @@ var doc = `{ "type": "string" }, "backup_strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] }, "backup_strategy_tip": { "type": "string" diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 5f8ad982d..c85877334 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -11765,7 +11765,13 @@ } }, "backup_strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] }, "description": { "type": "string" @@ -11779,7 +11785,7 @@ "exec_status": { "type": "string" }, - "instance_id ": { + "instance_id": { "type": "string" }, "instance_name": { @@ -17533,7 +17539,13 @@ "type": "object", "properties": { "strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] } } }, @@ -17616,7 +17628,13 @@ "type": "object", "properties": { "strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] } } }, @@ -18725,7 +18743,13 @@ "type": "string" }, "backup_strategy": { - "type": "string" + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "origin_row" + ] }, "backup_strategy_tip": { "type": "string" diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index ad7eb7889..109c8b6af 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -493,6 +493,11 @@ definitions: type: string type: array backup_strategy: + enum: + - none + - manual + - reverse_sql + - origin_row type: string description: type: string @@ -502,7 +507,7 @@ definitions: type: integer exec_status: type: string - 'instance_id ': + instance_id: type: string instance_name: type: string @@ -4427,6 +4432,11 @@ definitions: v1.UpdateSqlBackupStrategyReq: properties: strategy: + enum: + - none + - manual + - reverse_sql + - origin_row type: string type: object v1.UpdateSqlFileOrderV1Req: @@ -4482,6 +4492,11 @@ definitions: v1.UpdateTaskBackupStrategyReq: properties: strategy: + enum: + - none + - manual + - reverse_sql + - origin_row type: string type: object v1.UpdateWechatConfigurationReqV1: @@ -5245,6 +5260,11 @@ definitions: audit_status: type: string backup_strategy: + enum: + - none + - manual + - reverse_sql + - origin_row type: string backup_strategy_tip: type: string