Skip to content

Commit 9dcfff4

Browse files
authored
Merge pull request #3156 from actiontech/global_data_export_sqle_ce
swagger: add api definition for retrieving global data export workflo…
2 parents c67969c + 6d2a74e commit 9dcfff4

File tree

6 files changed

+471
-0
lines changed

6 files changed

+471
-0
lines changed

sqle/api/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
508508
v1Router.GET("/dashboard/sql_manages", v1.GetGlobalSqlManageList)
509509
v1Router.GET("/dashboard/sql_manages/statistics", v1.GetGlobalSqlManageStatistics)
510510
v1Router.GET("/dashboard/workflows", v1.GetGlobalWorkflowsV1)
511+
v1Router.GET("/dashboard/data_export_workflows", v1.GetGlobalDataExportWorkflowsV1)
511512
v1Router.GET("/dashboard/workflows/statistics", v1.GetGlobalWorkflowStatistics)
513+
v1Router.GET("/dashboard/data_export_workflows/statistics", v1.GetGlobalDataExportWorkflowStatisticsV1)
512514

513515
// configurations
514516
v1Router.GET("/configurations/drivers", v1.GetDrivers)

sqle/api/controller/v1/workflow.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,42 @@ func GetGlobalWorkflowStatistics(c echo.Context) error {
929929
})
930930
}
931931

932+
// GetGlobalDataExportWorkflowsV1
933+
// @Summary 获取全局导出工单列表
934+
// @Description get global data export workflows list
935+
// @Tags workflow
936+
// @Id getGlobalDataExportWorkflowsV1
937+
// @Security ApiKeyAuth
938+
// @Param filter_create_user_id query string false "filter create user id"
939+
// @Param filter_status_list query []string false "filter by workflow status,support using many status" Enums(wait_for_approve,wait_for_export,exporting,failed,rejected,cancel,finish)
940+
// @Param filter_project_uid query string false "filter by project uid"
941+
// @Param filter_instance_id query string false "filter by instance id in project"
942+
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
943+
// @Param page_index query uint32 true "page index"
944+
// @Param page_size query uint32 true "size of per page"
945+
// @Success 200 {object} v1.GetWorkflowsResV1
946+
// @router /v1/dashboard/data_export_workflows [get]
947+
func GetGlobalDataExportWorkflowsV1(c echo.Context) error {
948+
return getGlobalDataExportWorkflowsV1(c)
949+
}
950+
951+
// GetGlobalDataExportWorkflowStatisticsV1
952+
// @Summary 获取全局导出工单统计数据
953+
// @Description get global data export workflows statistics
954+
// @Tags workflow
955+
// @Id getGlobalDataExportWorkflowStatisticsV1
956+
// @Security ApiKeyAuth
957+
// @Param filter_create_user_id query string false "filter create user id"
958+
// @Param filter_status_list query []string false "filter by workflow status,support using many status" Enums(wait_for_approve,wait_for_export,exporting,failed,rejected,cancel,finish)
959+
// @Param filter_project_uid query string false "filter by project uid"
960+
// @Param filter_instance_id query string false "filter by instance id in project"
961+
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
962+
// @Success 200 {object} v1.GlobalWorkflowStatisticsResV1
963+
// @router /v1/dashboard/data_export_workflows/statistics [get]
964+
func GetGlobalDataExportWorkflowStatisticsV1(c echo.Context) error {
965+
return getGlobalDataExportWorkflowStatisticsV1(c)
966+
}
967+
932968
type globalWorkflowBasicFilter struct {
933969
FilterCreateUserId string `json:"filter_create_user_id" query:"filter_create_user_id"`
934970
FilterStatusList []string `json:"filter_status_list" query:"filter_status_list" validate:"dive,oneof=wait_for_audit wait_for_execution rejected canceled executing exec_failed finished"`

sqle/api/controller/v1/workflow_ce.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var (
2121
errCommunityEditionDoesNotSupportFeatureExportWorkflowList = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support feature export workflow list"))
2222
errCommunityEditionDoesNotSupportWorkflowTemplate = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support workflow template"))
2323
errCommunityEditionDoesNotSupportFileOrder = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support file order"))
24+
errCommunityEditionDoesNotSupportDataExportWorkflowList = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support data export workflow list"))
2425
)
2526

2627
func exportWorkflowV1(c echo.Context) error {
@@ -50,3 +51,11 @@ func updateWorkflowTemplate(c echo.Context) error {
5051
func updateSqlFileOrderByWorkflow(c echo.Context) error {
5152
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportFileOrder)
5253
}
54+
55+
func getGlobalDataExportWorkflowsV1(c echo.Context) error {
56+
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportDataExportWorkflowList)
57+
}
58+
59+
func getGlobalDataExportWorkflowStatisticsV1(c echo.Context) error {
60+
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportDataExportWorkflowList)
61+
}

sqle/docs/docs.go

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,164 @@ var doc = `{
10261026
}
10271027
}
10281028
},
1029+
"/v1/dashboard/data_export_workflows": {
1030+
"get": {
1031+
"security": [
1032+
{
1033+
"ApiKeyAuth": []
1034+
}
1035+
],
1036+
"description": "get global data export workflows list",
1037+
"tags": [
1038+
"workflow"
1039+
],
1040+
"summary": "获取全局导出工单列表",
1041+
"operationId": "getGlobalDataExportWorkflowsV1",
1042+
"parameters": [
1043+
{
1044+
"type": "string",
1045+
"description": "filter create user id",
1046+
"name": "filter_create_user_id",
1047+
"in": "query"
1048+
},
1049+
{
1050+
"enum": [
1051+
"wait_for_approve",
1052+
"wait_for_export",
1053+
"exporting",
1054+
"failed",
1055+
"rejected",
1056+
"cancel",
1057+
"finish"
1058+
],
1059+
"type": "array",
1060+
"items": {
1061+
"type": "string"
1062+
},
1063+
"description": "filter by workflow status,support using many status",
1064+
"name": "filter_status_list",
1065+
"in": "query"
1066+
},
1067+
{
1068+
"type": "string",
1069+
"description": "filter by project uid",
1070+
"name": "filter_project_uid",
1071+
"in": "query"
1072+
},
1073+
{
1074+
"type": "string",
1075+
"description": "filter by instance id in project",
1076+
"name": "filter_instance_id",
1077+
"in": "query"
1078+
},
1079+
{
1080+
"enum": [
1081+
"high",
1082+
"medium",
1083+
"low"
1084+
],
1085+
"type": "string",
1086+
"description": "filter by project priority",
1087+
"name": "filter_project_priority",
1088+
"in": "query"
1089+
},
1090+
{
1091+
"type": "integer",
1092+
"description": "page index",
1093+
"name": "page_index",
1094+
"in": "query",
1095+
"required": true
1096+
},
1097+
{
1098+
"type": "integer",
1099+
"description": "size of per page",
1100+
"name": "page_size",
1101+
"in": "query",
1102+
"required": true
1103+
}
1104+
],
1105+
"responses": {
1106+
"200": {
1107+
"description": "OK",
1108+
"schema": {
1109+
"$ref": "#/definitions/v1.GetWorkflowsResV1"
1110+
}
1111+
}
1112+
}
1113+
}
1114+
},
1115+
"/v1/dashboard/data_export_workflows/statistics": {
1116+
"get": {
1117+
"security": [
1118+
{
1119+
"ApiKeyAuth": []
1120+
}
1121+
],
1122+
"description": "get global data export workflows statistics",
1123+
"tags": [
1124+
"workflow"
1125+
],
1126+
"summary": "获取全局导出工单统计数据",
1127+
"operationId": "getGlobalDataExportWorkflowStatisticsV1",
1128+
"parameters": [
1129+
{
1130+
"type": "string",
1131+
"description": "filter create user id",
1132+
"name": "filter_create_user_id",
1133+
"in": "query"
1134+
},
1135+
{
1136+
"enum": [
1137+
"wait_for_approve",
1138+
"wait_for_export",
1139+
"exporting",
1140+
"failed",
1141+
"rejected",
1142+
"cancel",
1143+
"finish"
1144+
],
1145+
"type": "array",
1146+
"items": {
1147+
"type": "string"
1148+
},
1149+
"description": "filter by workflow status,support using many status",
1150+
"name": "filter_status_list",
1151+
"in": "query"
1152+
},
1153+
{
1154+
"type": "string",
1155+
"description": "filter by project uid",
1156+
"name": "filter_project_uid",
1157+
"in": "query"
1158+
},
1159+
{
1160+
"type": "string",
1161+
"description": "filter by instance id in project",
1162+
"name": "filter_instance_id",
1163+
"in": "query"
1164+
},
1165+
{
1166+
"enum": [
1167+
"high",
1168+
"medium",
1169+
"low"
1170+
],
1171+
"type": "string",
1172+
"description": "filter by project priority",
1173+
"name": "filter_project_priority",
1174+
"in": "query"
1175+
}
1176+
],
1177+
"responses": {
1178+
"200": {
1179+
"description": "OK",
1180+
"schema": {
1181+
"$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1"
1182+
}
1183+
}
1184+
}
1185+
}
1186+
},
10291187
"/v1/dashboard/sql_manages": {
10301188
"get": {
10311189
"security": [

0 commit comments

Comments
 (0)