feat(push-task): connect notification module with task module

- Add task_type to w_push_events table and GORM models.
- Implement OnTaskCompleted callback hook in task executor to avoid circular dependencies.
- Implement task listener in push package to trigger notifications on task completion.
- Automatically resolve User objects from payload and results.
- Enhance UI to select task completed events and preview default templates.
- Update Swagger documentation.
This commit is contained in:
ryan
2026-06-15 15:12:02 +08:00
parent de58b118b4
commit 2a3b9f8a5f
12 changed files with 540 additions and 60 deletions
+9 -4
View File
@@ -1458,7 +1458,7 @@ const docTemplate = `{
"SessionCookie": []
}
],
"description": "绑定系统内置事件、推送渠道、接收目标并创建通知事件配置,需要管理员权限",
"description": "绑定系统内置事件或异步任务、推送渠道、接收目标并创建通知事件配置,需要管理员权限",
"consumes": [
"application/json"
],
@@ -6012,6 +6012,10 @@ const docTemplate = `{
"type": "string"
}
},
"task_type": {
"description": "关联的异步任务类型",
"type": "string"
},
"template": {
"description": "消息模板 JSON",
"type": "string"
@@ -6513,9 +6517,6 @@ const docTemplate = `{
},
"push.CreateEventRequest": {
"type": "object",
"required": [
"event_key"
],
"properties": {
"channels": {
"type": "array",
@@ -6535,6 +6536,10 @@ const docTemplate = `{
"type": "string"
}
},
"task_type": {
"description": "关联的异步任务类型",
"type": "string"
},
"template": {
"type": "string"
}
+9 -4
View File
@@ -1451,7 +1451,7 @@
"SessionCookie": []
}
],
"description": "绑定系统内置事件、推送渠道、接收目标并创建通知事件配置,需要管理员权限",
"description": "绑定系统内置事件或异步任务、推送渠道、接收目标并创建通知事件配置,需要管理员权限",
"consumes": [
"application/json"
],
@@ -6005,6 +6005,10 @@
"type": "string"
}
},
"task_type": {
"description": "关联的异步任务类型",
"type": "string"
},
"template": {
"description": "消息模板 JSON",
"type": "string"
@@ -6506,9 +6510,6 @@
},
"push.CreateEventRequest": {
"type": "object",
"required": [
"event_key"
],
"properties": {
"channels": {
"type": "array",
@@ -6528,6 +6529,10 @@
"type": "string"
}
},
"task_type": {
"description": "关联的异步任务类型",
"type": "string"
},
"template": {
"type": "string"
}
+7 -3
View File
@@ -361,6 +361,9 @@ definitions:
items:
type: string
type: array
task_type:
description: 关联的异步任务类型
type: string
template:
description: 消息模板 JSON
type: string
@@ -715,10 +718,11 @@ definitions:
items:
type: string
type: array
task_type:
description: 关联的异步任务类型
type: string
template:
type: string
required:
- event_key
type: object
push.Definition:
properties:
@@ -2268,7 +2272,7 @@ paths:
post:
consumes:
- application/json
description: 绑定系统内置事件、推送渠道、接收目标并创建通知事件配置,需要管理员权限
description: 绑定系统内置事件或异步任务、推送渠道、接收目标并创建通知事件配置,需要管理员权限
parameters:
- description: 创建参数
in: body