From 2660970320042a23eec6d5fd0f2ebf45d0bcfaf4 Mon Sep 17 00:00:00 2001 From: hanxuanyu <2252193204@qq.com> Date: Fri, 30 Jan 2026 15:50:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=20Swagger=20=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=9C=80=E6=8A=93=E5=8F=96=E6=94=AF?= =?UTF-8?q?=E6=8C=81=EF=BC=9A=E6=96=B0=E5=A2=9E=20`enableOnDemandFetch`=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9=E5=92=8C=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=20202/404=20=E7=8A=B6=E6=80=81=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 112 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 112 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 75 +++++++++++++++++++++++++++++++ 3 files changed, 299 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index a575e51..73321c8 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -440,6 +440,24 @@ const docTemplate = `{ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -475,6 +493,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -517,6 +553,24 @@ const docTemplate = `{ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -545,6 +599,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -587,6 +659,24 @@ const docTemplate = `{ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -615,6 +705,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -730,6 +838,10 @@ const docTemplate = `{ "description": "当请求的地区不存在时,是否回退到默认地区", "type": "boolean" }, + "enableOnDemandFetch": { + "description": "是否启用按需抓取", + "type": "boolean" + }, "mode": { "description": "local | redirect", "type": "string" diff --git a/docs/swagger.json b/docs/swagger.json index a88c272..a51019b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -434,6 +434,24 @@ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -469,6 +487,24 @@ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -511,6 +547,24 @@ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -539,6 +593,24 @@ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -581,6 +653,24 @@ "schema": { "type": "file" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -609,6 +699,24 @@ "schema": { "$ref": "#/definitions/handlers.ImageMetaResp" } + }, + "202": { + "description": "按需抓取任务已启动", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "图片未找到,响应体包含具体原因", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } } } @@ -724,6 +832,10 @@ "description": "当请求的地区不存在时,是否回退到默认地区", "type": "boolean" }, + "enableOnDemandFetch": { + "description": "是否启用按需抓取", + "type": "boolean" + }, "mode": { "description": "local | redirect", "type": "string" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 214810b..09621d1 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -5,6 +5,9 @@ definitions: enableMktFallback: description: 当请求的地区不存在时,是否回退到默认地区 type: boolean + enableOnDemandFetch: + description: 是否启用按需抓取 + type: boolean mode: description: local | redirect type: string @@ -543,6 +546,18 @@ paths: description: OK schema: type: file + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取指定日期图片 tags: - image @@ -566,6 +581,18 @@ paths: description: OK schema: $ref: '#/definitions/handlers.ImageMetaResp' + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取指定日期图片元数据 tags: - image @@ -594,6 +621,18 @@ paths: description: OK schema: type: file + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取随机图片 tags: - image @@ -612,6 +651,18 @@ paths: description: OK schema: $ref: '#/definitions/handlers.ImageMetaResp' + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取随机图片元数据 tags: - image @@ -641,6 +692,18 @@ paths: description: OK schema: type: file + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取今日图片 tags: - image @@ -659,6 +722,18 @@ paths: description: OK schema: $ref: '#/definitions/handlers.ImageMetaResp' + "202": + description: 按需抓取任务已启动 + schema: + additionalProperties: + type: string + type: object + "404": + description: 图片未找到,响应体包含具体原因 + schema: + additionalProperties: + type: string + type: object summary: 获取今日图片元数据 tags: - image