Skip to content

Conversation

@iwanghc
Copy link
Collaborator

@iwanghc iwanghc commented Oct 23, 2025

User description

…ws and their statistics

关联的 issue

https://github.com/actiontech/sqle-ee/issues/2560

描述你的变更

Dashboard中展示数据导出工单列表和统计信息接口定义(接口出入参复用了上线工单的)

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc


Description

  • 添加 data_export_workflows 路由及统计接口

  • 新增数据导出工单错误处理及返回提示

  • 更新 Swagger 文档定义(docs.go, swagger.json, swagger.yaml)


Diagram Walkthrough

flowchart LR
  A["修改 \"sqle/api/app.go\" 添加路由"]
  B["添加 \"workflow.go\" 新处理函数"]
  C["添加 \"workflow_ce.go\" 错误处理函数"]
  D["更新文档 (docs.go, swagger.json, swagger.yaml)"]
  A -- "调用" --> B
  B -- "调用" --> C
  C -- "更新" --> D
Loading

File Walkthrough

Relevant files
Enhancement
app.go
添加全局导出工单路由                                                                                             

sqle/api/app.go

  • 添加 /dashboard/data_export_workflows 路由
  • 添加 /dashboard/data_export_workflows/statistics 路由
+2/-0     
workflow.go
添加数据导出工单处理函数                                                                                         

sqle/api/controller/v1/workflow.go

  • 新增 GetGlobalDataExportWorkflowsV1 方法
  • 新增 GetGlobalDataExportWorkflowStatisticsV1 方法
+36/-0   
workflow_ce.go
添加社区版数据导出工单错误处理                                                                                   

sqle/api/controller/v1/workflow_ce.go

  • 新增错误变量用于数据导出工单
  • 新增 getGlobalDataExportWorkflowsV1 方法
  • 新增 getGlobalDataExportWorkflowStatisticsV1 方法
+9/-0     
Documentation
docs.go
更新文档: 增加数据导出工单接口描述                                                                             

sqle/docs/docs.go

  • 增加数据导出工单接口的 Swagger 定义
+158/-0 
swagger.json
更新 swagger.json 数据导出接口规范                                                                 

sqle/docs/swagger.json

  • 增加数据导出工单接口描述及参数定义
+158/-0 
swagger.yaml
更新 swagger.yaml 数据导出接口描述                                                                 

sqle/docs/swagger.yaml

  • 增加数据导出工单及统计数据接口定义
+108/-0 

@github-actions
Copy link

PR Reviewer Guide 🔍

🎫 Ticket compliance analysis 🔶

2560 - Partially compliant

Compliant requirements:

  • 添加 data_export_workflows 路由及统计接口
  • 更新 API 文档 (docs.go, swagger.json, swagger.yaml)

Non-compliant requirements:

Requires further human verification:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

路由定义

建议确认新增路由与现有路由的命名和组织方式保持一致,确保接口调用的统一性。

v1Router.GET("/dashboard/data_export_workflows", v1.GetGlobalDataExportWorkflowsV1)
v1Router.GET("/dashboard/workflows/statistics", v1.GetGlobalWorkflowStatistics)
v1Router.GET("/dashboard/data_export_workflows/statistics", v1.GetGlobalDataExportWorkflowStatisticsV1)
接口文档

检查接口注释及 Swagger 注解在各 API 文件中的一致性,确保文档与实际功能相符。

// GetGlobalDataExportWorkflowsV1
// @Summary 获取全局导出工单列表
// @Description get global data export workflows list
// @Tags workflow
// @Id getGlobalDataExportWorkflowsV1
// @Security ApiKeyAuth
// @Param filter_create_user_id query string false "filter create user id"
// @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)
// @Param filter_project_uid query string false "filter by project uid"
// @Param filter_instance_id query string false "filter by instance id in project"
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
// @Param page_index query uint32 true "page index"
// @Param page_size query uint32 true "size of per page"
// @Success 200 {object} v1.GetWorkflowsResV1
// @router /v1/dashboard/data_export_workflows [get]
func GetGlobalDataExportWorkflowsV1(c echo.Context) error {
	return getGlobalDataExportWorkflowsV1(c)
}

// GetGlobalDataExportWorkflowStatisticsV1
// @Summary 获取全局导出工单统计数据
// @Description get global data export workflows statistics
// @Tags workflow
// @Id getGlobalDataExportWorkflowStatisticsV1
// @Security ApiKeyAuth
// @Param filter_create_user_id query string false "filter create user id"
// @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)
// @Param filter_project_uid query string false "filter by project uid"
// @Param filter_instance_id query string false "filter by instance id in project"
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
// @Success 200 {object} v1.GlobalWorkflowStatisticsResV1
// @router /v1/dashboard/data_export_workflows/statistics [get]
func GetGlobalDataExportWorkflowStatisticsV1(c echo.Context) error {
	return getGlobalDataExportWorkflowStatisticsV1(c)
}
文档更新

请确认 Swagger 文档的新增内容与业务需求完全匹配,特别注意安全信息和重复字段。

"/v1/dashboard/data_export_workflows": {
    "get": {
        "security": [
            {
                "ApiKeyAuth": []
            }
        ],
        "description": "get global data export workflows list",
        "tags": [
            "workflow"
        ],
        "summary": "获取全局导出工单列表",
        "operationId": "getGlobalDataExportWorkflowsV1",
        "parameters": [
            {
                "type": "string",
                "description": "filter create user id",
                "name": "filter_create_user_id",
                "in": "query"
            },
            {
                "enum": [
                    "wait_for_approve",
                    "wait_for_export",
                    "exporting",
                    "failed",
                    "rejected",
                    "cancel",
                    "finish"
                ],
                "type": "array",
                "items": {
                    "type": "string"
                },
                "description": "filter by workflow status,support using many status",
                "name": "filter_status_list",
                "in": "query"
            },
            {
                "type": "string",
                "description": "filter by project uid",
                "name": "filter_project_uid",
                "in": "query"
            },
            {
                "type": "string",
                "description": "filter by instance id in project",
                "name": "filter_instance_id",
                "in": "query"
            },
            {
                "enum": [
                    "high",
                    "medium",
                    "low"
                ],
                "type": "string",
                "description": "filter by project priority",
                "name": "filter_project_priority",
                "in": "query"
            },
            {
                "type": "integer",
                "description": "page index",
                "name": "page_index",
                "in": "query",
                "required": true
            },
            {
                "type": "integer",
                "description": "size of per page",
                "name": "page_size",
                "in": "query",
                "required": true
            }
        ],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "$ref": "#/definitions/v1.GetWorkflowsResV1"
                }
            }
        }
    }
},

@github-actions
Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

@winfredLIN winfredLIN merged commit 9dcfff4 into main Oct 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants