fix: 修复任务执行记录列表按任务类型和状态过滤失效的 Bug 并更新 Swagger

This commit is contained in:
ryan
2026-06-11 20:14:02 +08:00
parent 46760d4286
commit 7c125ccef2
6 changed files with 48 additions and 42 deletions
+9 -9
View File
@@ -5576,13 +5576,13 @@ const docTemplate = `{
"task.TaskMeta": { "task.TaskMeta": {
"type": "object", "type": "object",
"properties": { "properties": {
"asynqTask": { "asynq_task": {
"type": "string" "type": "string"
}, },
"description": { "description": {
"type": "string" "type": "string"
}, },
"maxRetry": { "max_retry": {
"type": "integer" "type": "integer"
}, },
"name": { "name": {
@@ -5601,7 +5601,7 @@ const docTemplate = `{
"description": "是否支持手动重试", "description": "是否支持手动重试",
"type": "boolean" "type": "boolean"
}, },
"supportsTime": { "supports_time": {
"type": "boolean" "type": "boolean"
}, },
"type": { "type": {
@@ -5612,27 +5612,27 @@ const docTemplate = `{
"task.TaskParam": { "task.TaskParam": {
"type": "object", "type": "object",
"properties": { "properties": {
"Description": { "description": {
"description": "描述", "description": "描述",
"type": "string" "type": "string"
}, },
"Label": { "label": {
"description": "显示名称", "description": "显示名称",
"type": "string" "type": "string"
}, },
"Name": { "name": {
"description": "参数键名", "description": "参数键名",
"type": "string" "type": "string"
}, },
"Placeholder": { "placeholder": {
"description": "占位符", "description": "占位符",
"type": "string" "type": "string"
}, },
"Required": { "required": {
"description": "是否必填", "description": "是否必填",
"type": "boolean" "type": "boolean"
}, },
"Type": { "type": {
"description": "类型:string, text, number, boolean", "description": "类型:string, text, number, boolean",
"type": "string" "type": "string"
} }
+9 -9
View File
@@ -5569,13 +5569,13 @@
"task.TaskMeta": { "task.TaskMeta": {
"type": "object", "type": "object",
"properties": { "properties": {
"asynqTask": { "asynq_task": {
"type": "string" "type": "string"
}, },
"description": { "description": {
"type": "string" "type": "string"
}, },
"maxRetry": { "max_retry": {
"type": "integer" "type": "integer"
}, },
"name": { "name": {
@@ -5594,7 +5594,7 @@
"description": "是否支持手动重试", "description": "是否支持手动重试",
"type": "boolean" "type": "boolean"
}, },
"supportsTime": { "supports_time": {
"type": "boolean" "type": "boolean"
}, },
"type": { "type": {
@@ -5605,27 +5605,27 @@
"task.TaskParam": { "task.TaskParam": {
"type": "object", "type": "object",
"properties": { "properties": {
"Description": { "description": {
"description": "描述", "description": "描述",
"type": "string" "type": "string"
}, },
"Label": { "label": {
"description": "显示名称", "description": "显示名称",
"type": "string" "type": "string"
}, },
"Name": { "name": {
"description": "参数键名", "description": "参数键名",
"type": "string" "type": "string"
}, },
"Placeholder": { "placeholder": {
"description": "占位符", "description": "占位符",
"type": "string" "type": "string"
}, },
"Required": { "required": {
"description": "是否必填", "description": "是否必填",
"type": "boolean" "type": "boolean"
}, },
"Type": { "type": {
"description": "类型:string, text, number, boolean", "description": "类型:string, text, number, boolean",
"type": "string" "type": "string"
} }
+9 -9
View File
@@ -751,11 +751,11 @@ definitions:
type: object type: object
task.TaskMeta: task.TaskMeta:
properties: properties:
asynqTask: asynq_task:
type: string type: string
description: description:
type: string type: string
maxRetry: max_retry:
type: integer type: integer
name: name:
type: string type: string
@@ -768,29 +768,29 @@ definitions:
retryable: retryable:
description: 是否支持手动重试 description: 是否支持手动重试
type: boolean type: boolean
supportsTime: supports_time:
type: boolean type: boolean
type: type:
type: string type: string
type: object type: object
task.TaskParam: task.TaskParam:
properties: properties:
Description: description:
description: 描述 description: 描述
type: string type: string
Label: label:
description: 显示名称 description: 显示名称
type: string type: string
Name: name:
description: 参数键名 description: 参数键名
type: string type: string
Placeholder: placeholder:
description: 占位符 description: 占位符
type: string type: string
Required: required:
description: 是否必填 description: 是否必填
type: boolean type: boolean
Type: type:
description: 类型:string, text, number, boolean description: 类型:string, text, number, boolean
type: string type: string
type: object type: object
+3
View File
@@ -1,3 +1,6 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
// Package cache provides HTTP handlers for managing disk cache. // Package cache provides HTTP handlers for managing disk cache.
package cache package cache
+3
View File
@@ -1,3 +1,6 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
// Package diskcache implements a platform-level disk-backed cache with size limit, TTL, and LRU eviction. // Package diskcache implements a platform-level disk-backed cache with size limit, TTL, and LRU eviction.
package diskcache package diskcache
+15 -15
View File
@@ -11,27 +11,27 @@ import (
// //
//nolint:revive // TaskParam 保留完整名称以避免与通用 Param 混淆 //nolint:revive // TaskParam 保留完整名称以避免与通用 Param 混淆
type TaskParam struct { type TaskParam struct {
Name string `json:"Name"` // 参数键名 Name string `json:"name"` // 参数键名
Label string `json:"Label"` // 显示名称 Label string `json:"label"` // 显示名称
Type string `json:"Type"` // 类型:string, text, number, boolean Type string `json:"type"` // 类型:string, text, number, boolean
Required bool `json:"Required"` // 是否必填 Required bool `json:"required"` // 是否必填
Placeholder string `json:"Placeholder"` // 占位符 Placeholder string `json:"placeholder"` // 占位符
Description string `json:"Description"` // 描述 Description string `json:"description"` // 描述
} }
// TaskMeta 任务元数据 // TaskMeta 任务元数据
// //
//nolint:revive // TaskMeta 保留完整名称以避免与通用 Meta 混淆 //nolint:revive // TaskMeta 保留完整名称以避免与通用 Meta 混淆
type TaskMeta struct { type TaskMeta struct {
Type string Type string `json:"type"`
AsynqTask string AsynqTask string `json:"asynq_task"`
Name string Name string `json:"name"`
Description string Description string `json:"description"`
SupportsTime bool SupportsTime bool `json:"supports_time"`
MaxRetry int MaxRetry int `json:"max_retry"`
Queue string Queue string `json:"queue"`
Retryable bool // 是否支持手动重试 Retryable bool `json:"retryable"` // 是否支持手动重试
Params []TaskParam Params []TaskParam `json:"params,omitempty"`
} }
var ( var (