Skip to content

Conversation

@LordofAvernus
Copy link
Collaborator

@LordofAvernus LordofAvernus commented Dec 5, 2025

User description

关联的 issue

#3171

描述你的变更

待解决工单支持筛选待操作人

确认项(pr提交后操作)

Tip

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


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


Description

  • 新增全局过滤参数用于待操作人筛选

  • 更新workflow接口及默认用户过滤逻辑

  • 完善API文档与Swagger文档说明


Diagram Walkthrough

flowchart LR
  A["新增SQL统计过滤参数"] --> B["更新workflow接口过滤逻辑"]
  B --> C["默认使用当前用户ID"]
  C --> D["更新API及Swagger文档"]
Loading

File Walkthrough

Relevant files
Enhancement
sql_manage.go
添加全局SQL统计过滤参数                                                                                       

sqle/api/controller/v1/sql_manage.go

  • 新增字段filter_current_step_assignee_user_id到统计请求结构
  • 更新Swagger注释添加新过滤参数说明
+5/-3     
workflow.go
扩展workflow过滤参数支持                                                                                 

sqle/api/controller/v1/workflow.go

  • 引入filter_current_step_assignee_user_id到workflow相关请求结构
  • 修改assignee过滤逻辑,默认使用当前用户ID
+42/-28 
Documentation
docs.go
更新API文档说明                                                                                               

sqle/docs/docs.go

  • 更新API文档,描述新过滤参数filter_current_step_assignee_user_id
+30/-0   
swagger.json
更新Swagger JSON文档                                                                                 

sqle/docs/swagger.json

  • 添加新参数filter_current_step_assignee_user_id到Swagger JSON文档
+30/-0   
swagger.yaml
更新Swagger YAML文档                                                                                 

sqle/docs/swagger.yaml

  • 插入新过滤参数filter_current_step_assignee_user_id至Swagger YAML文档
+20/-0   

…low statistics

- Introduced FilterCurrentStepAssigneeUserId to GetGlobalSqlManageStatisticsReq and GetGlobalWorkflowStatisticsReqV1 for enhanced filtering capabilities.
- Updated relevant functions to utilize the new filter for constructing global workflow basic filters.
- Added documentation for the new filter parameter in API definitions.
…ssignee_user_id

- Added the filter_current_step_assignee_user_id parameter to the API documentation for improved filtering options in workflow queries.
- Ensured the new parameter is documented consistently across relevant sections.
…ee_user_id

- Added the filter_current_step_assignee_user_id parameter to the API documentation across multiple formats (Go, JSON, YAML).
- Ensured consistent documentation for the new filter to improve query capabilities in workflows.
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

PR Reviewer Guide 🔍

🎫 Ticket compliance analysis 🔶

3171 - Partially compliant

Compliant requirements:

  • 支持待操作人筛选
  • 更新接口及文档说明

Non-compliant requirements:

Requires further human verification:

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

参数处理问题

请确认在新增的请求结构体中添加的参数 FilterCurrentStepAssigneeUserId 能够正确地传递和解析,确保前端传入的筛选参数与后端过滤逻辑保持一致。

	FilterProjectUid                *string                `query:"filter_project_uid" json:"filter_project_uid,omitempty"`
	FilterInstanceId                 *string                `query:"filter_instance_id" json:"filter_instance_id,omitempty"`
	FilterProjectPriority            *dmsV1.ProjectPriority `query:"filter_project_priority" json:"filter_project_priority,omitempty" enums:"high,medium,low"`
	FilterCurrentStepAssigneeUserId  *string                `query:"filter_current_step_assignee_user_id" json:"filter_current_step_assignee_user_id,omitempty"`
}
权限过滤逻辑

请检查在全局工单过滤器中,对待操作人参数的默认赋值是否符合设计意图,特别是在用户可视范围为受让人的场景下,确认传入的筛选参数不会被错误覆盖。

	// 如果请求中已经指定了待操作人筛选,则使用请求中的值,否则使用当前用户ID
	if req.FilterCurrentStepAssigneeUserId == "" {
		data["filter_current_step_assignee_user_id"] = user.GetIDStr()
	}
}

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@winfredLIN winfredLIN merged commit c83ced7 into main Dec 5, 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