Skip to content

Commit 83c5024

Browse files
authored
Merge pull request #2641 from actiontech/sql_version_manage
Sql version manage
2 parents 02773af + 589b53f commit 83c5024

7 files changed

Lines changed: 26 additions & 23 deletions

File tree

sqle/api/app.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/actiontech/dms/pkg/dms-common/i18nPkg"
1212
"github.com/actiontech/sqle/sqle/dms"
1313
"github.com/actiontech/sqle/sqle/locale"
14+
1415
// "github.com/actiontech/sqle/sqle/api/cloudbeaver_wrapper"
1516
"github.com/actiontech/sqle/sqle/api/controller"
1617
v1 "github.com/actiontech/sqle/sqle/api/controller/v1"
@@ -260,7 +261,7 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
260261
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/lock", v1.LockSqlVersion)
261262
v1ProjectRouter.GET("/:project_name/sql_versions/:sql_version_id/sql_version_stages/:sql_version_stage_id/dependencies", v1.GetDependenciesBetweenStageInstance)
262263
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/batch_release_workflows", v1.BatchReleaseWorkflows)
263-
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/batch_execute_workflows", v1.BatchExecuteTasksOnWorkflow)
264+
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/batch_execute_workflows", v1.BatchExecuteWorkflows)
264265
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/retry_workflow ", v1.RetryExecWorkflow)
265266
v1ProjectRouter.POST("/:project_name/sql_versions/:sql_version_id/sql_version_stages/:sql_version_stage_id/associate_workflows", v1.BatchAssociateWorkflowsWithVersion)
266267
v1ProjectRouter.GET("/:project_name/sql_versions/:sql_version_id/sql_version_stages/:sql_version_stage_id/associate_workflows", v1.GetWorkflowsThatCanBeAssociatedToVersion)

sqle/api/controller/v1/sql_version.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,26 +292,26 @@ func BatchReleaseWorkflows(c echo.Context) error {
292292
return batchReleaseWorkflows(c)
293293
}
294294

295-
type BatchExecuteTasksOnWorkflowReqV1 struct {
295+
type BatchExecuteWorkflowsReqV1 struct {
296296
WorkflowIDs []string `json:"workflow_ids" valid:"required"`
297297
}
298298

299299
// @Summary 工单批量上线
300-
// @Description batch execute tasks on workflow
300+
// @Description batch execute workflows
301301
// @Tags sql_version
302-
// @Id batchExecuteTasksOnWorkflowV1
302+
// @Id batchExecuteWorkflowsV1
303303
// @Security ApiKeyAuth
304304
// @Param project_name path string true "project name"
305305
// @Param sql_version_id path string true "sql version id"
306-
// @Param data body v1.BatchExecuteTasksOnWorkflowReqV1 true "batch execute tasks on workflow request"
306+
// @Param data body v1.BatchExecuteWorkflowsReqV1 true "batch execute workflows request"
307307
// @Success 200 {object} controller.BaseRes
308308
// @router /v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows [post]
309-
func BatchExecuteTasksOnWorkflow(c echo.Context) error {
309+
func BatchExecuteWorkflows(c echo.Context) error {
310310
/**
311311
1、遍历workflow id,获取workflow信息
312312
2、参考func ExecuteTasksOnWorkflowV2(c echo.Context) error 执行上线
313313
**/
314-
return batchExecuteTasksOnWorkflow(c)
314+
return batchExecuteWorkflows(c)
315315
}
316316

317317
type RetryExecWorkflowReqV1 struct {

sqle/api/controller/v1/sql_version_ce.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func batchReleaseWorkflows(c echo.Context) error {
3737
return ErrCommunityEditionNotSupportSqlManage
3838
}
3939

40-
func batchExecuteTasksOnWorkflow(c echo.Context) error {
40+
func batchExecuteWorkflows(c echo.Context) error {
4141
return ErrCommunityEditionNotSupportSqlManage
4242
}
4343
func retryExecWorkflow(c echo.Context) error {

sqle/docs/docs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5471,12 +5471,12 @@ var doc = `{
54715471
"ApiKeyAuth": []
54725472
}
54735473
],
5474-
"description": "batch execute tasks on workflow",
5474+
"description": "batch execute workflows",
54755475
"tags": [
54765476
"sql_version"
54775477
],
54785478
"summary": "工单批量上线",
5479-
"operationId": "batchExecuteTasksOnWorkflowV1",
5479+
"operationId": "batchExecuteWorkflowsV1",
54805480
"parameters": [
54815481
{
54825482
"type": "string",
@@ -5493,12 +5493,12 @@ var doc = `{
54935493
"required": true
54945494
},
54955495
{
5496-
"description": "batch execute tasks on workflow request",
5496+
"description": "batch execute workflows request",
54975497
"name": "data",
54985498
"in": "body",
54995499
"required": true,
55005500
"schema": {
5501-
"$ref": "#/definitions/v1.BatchExecuteTasksOnWorkflowReqV1"
5501+
"$ref": "#/definitions/v1.BatchExecuteWorkflowsReqV1"
55025502
}
55035503
}
55045504
],
@@ -11193,7 +11193,7 @@ var doc = `{
1119311193
}
1119411194
}
1119511195
},
11196-
"v1.BatchExecuteTasksOnWorkflowReqV1": {
11196+
"v1.BatchExecuteWorkflowsReqV1": {
1119711197
"type": "object",
1119811198
"properties": {
1119911199
"workflow_ids": {

sqle/docs/swagger.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5455,12 +5455,12 @@
54555455
"ApiKeyAuth": []
54565456
}
54575457
],
5458-
"description": "batch execute tasks on workflow",
5458+
"description": "batch execute workflows",
54595459
"tags": [
54605460
"sql_version"
54615461
],
54625462
"summary": "工单批量上线",
5463-
"operationId": "batchExecuteTasksOnWorkflowV1",
5463+
"operationId": "batchExecuteWorkflowsV1",
54645464
"parameters": [
54655465
{
54665466
"type": "string",
@@ -5477,12 +5477,12 @@
54775477
"required": true
54785478
},
54795479
{
5480-
"description": "batch execute tasks on workflow request",
5480+
"description": "batch execute workflows request",
54815481
"name": "data",
54825482
"in": "body",
54835483
"required": true,
54845484
"schema": {
5485-
"$ref": "#/definitions/v1.BatchExecuteTasksOnWorkflowReqV1"
5485+
"$ref": "#/definitions/v1.BatchExecuteWorkflowsReqV1"
54865486
}
54875487
}
54885488
],
@@ -11177,7 +11177,7 @@
1117711177
}
1117811178
}
1117911179
},
11180-
"v1.BatchExecuteTasksOnWorkflowReqV1": {
11180+
"v1.BatchExecuteWorkflowsReqV1": {
1118111181
"type": "object",
1118211182
"properties": {
1118311183
"workflow_ids": {

sqle/docs/swagger.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ definitions:
498498
type: string
499499
type: array
500500
type: object
501-
v1.BatchExecuteTasksOnWorkflowReqV1:
501+
v1.BatchExecuteWorkflowsReqV1:
502502
properties:
503503
workflow_ids:
504504
items:
@@ -9002,8 +9002,8 @@ paths:
90029002
- sql_version
90039003
/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows:
90049004
post:
9005-
description: batch execute tasks on workflow
9006-
operationId: batchExecuteTasksOnWorkflowV1
9005+
description: batch execute workflows
9006+
operationId: batchExecuteWorkflowsV1
90079007
parameters:
90089008
- description: project name
90099009
in: path
@@ -9015,12 +9015,12 @@ paths:
90159015
name: sql_version_id
90169016
required: true
90179017
type: string
9018-
- description: batch execute tasks on workflow request
9018+
- description: batch execute workflows request
90199019
in: body
90209020
name: data
90219021
required: true
90229022
schema:
9023-
$ref: '#/definitions/v1.BatchExecuteTasksOnWorkflowReqV1'
9023+
$ref: '#/definitions/v1.BatchExecuteWorkflowsReqV1'
90249024
responses:
90259025
"200":
90269026
description: OK

sqle/errors/errors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const (
4545

4646
SQLOptimizationCommunityNotSupported = 8004
4747

48+
SQLVersionNotAllTasksExecutedSuccess = 8005
49+
4850
// 需要隐藏所有错误细节或不确定时使用
4951
GenericError ErrorCode = 9999
5052
)

0 commit comments

Comments
 (0)