增加多地区每日图片抓取能力

This commit is contained in:
2026-01-30 13:33:40 +08:00
parent b69db53f0a
commit 93690e10d3
24 changed files with 980 additions and 149 deletions

View File

@@ -413,6 +413,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
},
{
"type": "string",
"default": "UHD",
@@ -455,6 +461,12 @@ const docTemplate = `{
"name": "date",
"in": "path",
"required": true
},
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
}
],
"responses": {
@@ -478,6 +490,12 @@ const docTemplate = `{
],
"summary": "获取随机图片",
"parameters": [
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
},
{
"type": "string",
"default": "UHD",
@@ -513,6 +531,14 @@ const docTemplate = `{
"image"
],
"summary": "获取随机图片元数据",
"parameters": [
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
@@ -534,6 +560,12 @@ const docTemplate = `{
],
"summary": "获取今日图片",
"parameters": [
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
},
{
"type": "string",
"default": "UHD",
@@ -569,6 +601,14 @@ const docTemplate = `{
"image"
],
"summary": "获取今日图片元数据",
"parameters": [
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
@@ -614,6 +654,12 @@ const docTemplate = `{
"description": "按月份过滤 (格式: YYYY-MM)",
"name": "month",
"in": "query"
},
{
"type": "string",
"description": "地区编码 (如 zh-CN, en-US)",
"name": "mkt",
"in": "query"
}
],
"responses": {
@@ -628,12 +674,39 @@ const docTemplate = `{
}
}
}
},
"/regions": {
"get": {
"description": "返回系统支持的所有必应地区编码及标签。如果配置中指定了抓取地区,这些地区将排在列表最前面(置顶)。",
"produces": [
"application/json"
],
"tags": [
"image"
],
"summary": "获取支持的地区列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/util.Region"
}
}
}
}
}
}
},
"definitions": {
"config.APIConfig": {
"type": "object",
"properties": {
"enableMktFallback": {
"description": "当请求的地区不存在时,是否回退到默认地区",
"type": "boolean"
},
"mode": {
"description": "local | redirect",
"type": "string"
@@ -666,6 +739,9 @@ const docTemplate = `{
"feature": {
"$ref": "#/definitions/config.FeatureConfig"
},
"fetcher": {
"$ref": "#/definitions/config.FetcherConfig"
},
"log": {
"$ref": "#/definitions/config.LogConfig"
},
@@ -717,6 +793,17 @@ const docTemplate = `{
}
}
},
"config.FetcherConfig": {
"type": "object",
"properties": {
"regions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"config.LocalConfig": {
"type": "object",
"properties": {
@@ -917,6 +1004,9 @@ const docTemplate = `{
"hsh": {
"type": "string"
},
"mkt": {
"type": "string"
},
"quiz": {
"type": "string"
},
@@ -1006,6 +1096,17 @@ const docTemplate = `{
"type": "string"
}
}
},
"util.Region": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"securityDefinitions": {