From 7c125ccef28cbd9d3f61146b351c268517ae8c47 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 11 Jun 2026 20:14:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E6=8C=89?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B=E5=92=8C=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=A4=B1=E6=95=88=E7=9A=84=20Bug=20=E5=B9=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Swagger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 18 ++++++++--------- docs/swagger.json | 18 ++++++++--------- docs/swagger.yaml | 18 ++++++++--------- internal/apps/admin/cache/routers.go | 3 +++ internal/diskcache/cache.go | 3 +++ internal/task/meta.go | 30 ++++++++++++++-------------- 6 files changed, 48 insertions(+), 42 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 6b35f536..48e913fc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -5576,13 +5576,13 @@ const docTemplate = `{ "task.TaskMeta": { "type": "object", "properties": { - "asynqTask": { + "asynq_task": { "type": "string" }, "description": { "type": "string" }, - "maxRetry": { + "max_retry": { "type": "integer" }, "name": { @@ -5601,7 +5601,7 @@ const docTemplate = `{ "description": "是否支持手动重试", "type": "boolean" }, - "supportsTime": { + "supports_time": { "type": "boolean" }, "type": { @@ -5612,27 +5612,27 @@ const docTemplate = `{ "task.TaskParam": { "type": "object", "properties": { - "Description": { + "description": { "description": "描述", "type": "string" }, - "Label": { + "label": { "description": "显示名称", "type": "string" }, - "Name": { + "name": { "description": "参数键名", "type": "string" }, - "Placeholder": { + "placeholder": { "description": "占位符", "type": "string" }, - "Required": { + "required": { "description": "是否必填", "type": "boolean" }, - "Type": { + "type": { "description": "类型:string, text, number, boolean", "type": "string" } diff --git a/docs/swagger.json b/docs/swagger.json index 38ead169..fdec8678 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -5569,13 +5569,13 @@ "task.TaskMeta": { "type": "object", "properties": { - "asynqTask": { + "asynq_task": { "type": "string" }, "description": { "type": "string" }, - "maxRetry": { + "max_retry": { "type": "integer" }, "name": { @@ -5594,7 +5594,7 @@ "description": "是否支持手动重试", "type": "boolean" }, - "supportsTime": { + "supports_time": { "type": "boolean" }, "type": { @@ -5605,27 +5605,27 @@ "task.TaskParam": { "type": "object", "properties": { - "Description": { + "description": { "description": "描述", "type": "string" }, - "Label": { + "label": { "description": "显示名称", "type": "string" }, - "Name": { + "name": { "description": "参数键名", "type": "string" }, - "Placeholder": { + "placeholder": { "description": "占位符", "type": "string" }, - "Required": { + "required": { "description": "是否必填", "type": "boolean" }, - "Type": { + "type": { "description": "类型:string, text, number, boolean", "type": "string" } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a9b812a0..fc6bdad3 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -751,11 +751,11 @@ definitions: type: object task.TaskMeta: properties: - asynqTask: + asynq_task: type: string description: type: string - maxRetry: + max_retry: type: integer name: type: string @@ -768,29 +768,29 @@ definitions: retryable: description: 是否支持手动重试 type: boolean - supportsTime: + supports_time: type: boolean type: type: string type: object task.TaskParam: properties: - Description: + description: description: 描述 type: string - Label: + label: description: 显示名称 type: string - Name: + name: description: 参数键名 type: string - Placeholder: + placeholder: description: 占位符 type: string - Required: + required: description: 是否必填 type: boolean - Type: + type: description: 类型:string, text, number, boolean type: string type: object diff --git a/internal/apps/admin/cache/routers.go b/internal/apps/admin/cache/routers.go index 858d6687..c71b3167 100644 --- a/internal/apps/admin/cache/routers.go +++ b/internal/apps/admin/cache/routers.go @@ -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 diff --git a/internal/diskcache/cache.go b/internal/diskcache/cache.go index 9721d577..8942053e 100644 --- a/internal/diskcache/cache.go +++ b/internal/diskcache/cache.go @@ -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 diff --git a/internal/task/meta.go b/internal/task/meta.go index 8c11301b..019fc637 100644 --- a/internal/task/meta.go +++ b/internal/task/meta.go @@ -11,27 +11,27 @@ import ( // //nolint:revive // TaskParam 保留完整名称以避免与通用 Param 混淆 type TaskParam struct { - Name string `json:"Name"` // 参数键名 - Label string `json:"Label"` // 显示名称 - Type string `json:"Type"` // 类型:string, text, number, boolean - Required bool `json:"Required"` // 是否必填 - Placeholder string `json:"Placeholder"` // 占位符 - Description string `json:"Description"` // 描述 + Name string `json:"name"` // 参数键名 + Label string `json:"label"` // 显示名称 + Type string `json:"type"` // 类型:string, text, number, boolean + Required bool `json:"required"` // 是否必填 + Placeholder string `json:"placeholder"` // 占位符 + Description string `json:"description"` // 描述 } // TaskMeta 任务元数据 // //nolint:revive // TaskMeta 保留完整名称以避免与通用 Meta 混淆 type TaskMeta struct { - Type string - AsynqTask string - Name string - Description string - SupportsTime bool - MaxRetry int - Queue string - Retryable bool // 是否支持手动重试 - Params []TaskParam + Type string `json:"type"` + AsynqTask string `json:"asynq_task"` + Name string `json:"name"` + Description string `json:"description"` + SupportsTime bool `json:"supports_time"` + MaxRetry int `json:"max_retry"` + Queue string `json:"queue"` + Retryable bool `json:"retryable"` // 是否支持手动重试 + Params []TaskParam `json:"params,omitempty"` } var (