From 89b7f1ae3a46b552c03136875a0807e36b705a16 Mon Sep 17 00:00:00 2001 From: hanxuanyu <2252193204@qq.com> Date: Tue, 27 Jan 2026 10:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EWebConfig=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=8C=E5=AE=8C=E5=96=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=B9WebP=E6=A0=BC=E5=BC=8F=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 58 +++++++++++++++++++++++++++++++++++++++++------ docs/swagger.json | 58 +++++++++++++++++++++++++++++++++++++++++------ docs/swagger.yaml | 39 +++++++++++++++++++++++++++---- 3 files changed, 137 insertions(+), 18 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index d6885f2..5429901 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -399,8 +399,7 @@ const docTemplate = `{ "get": { "description": "根据日期返回图片流或重定向 (yyyy-mm-dd)", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -473,8 +472,7 @@ const docTemplate = `{ "get": { "description": "随机返回一张已抓取的图片流或重定向", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -531,8 +529,7 @@ const docTemplate = `{ "get": { "description": "根据参数返回今日必应图片流或重定向", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -549,7 +546,7 @@ const docTemplate = `{ { "type": "string", "default": "jpg", - "description": "格式 (jpg, webp)", + "description": "格式 (jpg)", "name": "format", "in": "query" } @@ -669,6 +666,9 @@ const docTemplate = `{ }, "token": { "$ref": "#/definitions/config.TokenConfig" + }, + "web": { + "$ref": "#/definitions/config.WebConfig" } } }, @@ -714,8 +714,44 @@ const docTemplate = `{ "config.LogConfig": { "type": "object", "properties": { + "compress": { + "description": "是否压缩旧日志文件", + "type": "boolean" + }, + "dbfilename": { + "description": "数据库日志文件名", + "type": "string" + }, + "dblogLevel": { + "description": "数据库日志级别: debug, info, warn, error", + "type": "string" + }, + "filename": { + "description": "业务日志文件名", + "type": "string" + }, "level": { "type": "string" + }, + "logConsole": { + "description": "是否同时输出到控制台", + "type": "boolean" + }, + "maxAge": { + "description": "保留旧日志文件最大天数", + "type": "integer" + }, + "maxBackups": { + "description": "保留旧日志文件最大个数", + "type": "integer" + }, + "maxSize": { + "description": "每个日志文件最大大小 (MB)", + "type": "integer" + }, + "showDBLog": { + "description": "是否在控制台显示数据库日志", + "type": "boolean" } } }, @@ -790,6 +826,14 @@ const docTemplate = `{ } } }, + "config.WebConfig": { + "type": "object", + "properties": { + "path": { + "type": "string" + } + } + }, "config.WebDAVConfig": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 908b0a1..331d5b4 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -393,8 +393,7 @@ "get": { "description": "根据日期返回图片流或重定向 (yyyy-mm-dd)", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -467,8 +466,7 @@ "get": { "description": "随机返回一张已抓取的图片流或重定向", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -525,8 +523,7 @@ "get": { "description": "根据参数返回今日必应图片流或重定向", "produces": [ - "image/jpeg", - "image/webp" + "image/jpeg" ], "tags": [ "image" @@ -543,7 +540,7 @@ { "type": "string", "default": "jpg", - "description": "格式 (jpg, webp)", + "description": "格式 (jpg)", "name": "format", "in": "query" } @@ -663,6 +660,9 @@ }, "token": { "$ref": "#/definitions/config.TokenConfig" + }, + "web": { + "$ref": "#/definitions/config.WebConfig" } } }, @@ -708,8 +708,44 @@ "config.LogConfig": { "type": "object", "properties": { + "compress": { + "description": "是否压缩旧日志文件", + "type": "boolean" + }, + "dbfilename": { + "description": "数据库日志文件名", + "type": "string" + }, + "dblogLevel": { + "description": "数据库日志级别: debug, info, warn, error", + "type": "string" + }, + "filename": { + "description": "业务日志文件名", + "type": "string" + }, "level": { "type": "string" + }, + "logConsole": { + "description": "是否同时输出到控制台", + "type": "boolean" + }, + "maxAge": { + "description": "保留旧日志文件最大天数", + "type": "integer" + }, + "maxBackups": { + "description": "保留旧日志文件最大个数", + "type": "integer" + }, + "maxSize": { + "description": "每个日志文件最大大小 (MB)", + "type": "integer" + }, + "showDBLog": { + "description": "是否在控制台显示数据库日志", + "type": "boolean" } } }, @@ -784,6 +820,14 @@ } } }, + "config.WebConfig": { + "type": "object", + "properties": { + "path": { + "type": "string" + } + } + }, "config.WebDAVConfig": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 0c377fc..7044fbc 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -33,6 +33,8 @@ definitions: $ref: '#/definitions/config.StorageConfig' token: $ref: '#/definitions/config.TokenConfig' + web: + $ref: '#/definitions/config.WebConfig' type: object config.CronConfig: properties: @@ -61,8 +63,35 @@ definitions: type: object config.LogConfig: properties: + compress: + description: 是否压缩旧日志文件 + type: boolean + dbfilename: + description: 数据库日志文件名 + type: string + dblogLevel: + description: '数据库日志级别: debug, info, warn, error' + type: string + filename: + description: 业务日志文件名 + type: string level: type: string + logConsole: + description: 是否同时输出到控制台 + type: boolean + maxAge: + description: 保留旧日志文件最大天数 + type: integer + maxBackups: + description: 保留旧日志文件最大个数 + type: integer + maxSize: + description: 每个日志文件最大大小 (MB) + type: integer + showDBLog: + description: 是否在控制台显示数据库日志 + type: boolean type: object config.RetentionConfig: properties: @@ -110,6 +139,11 @@ definitions: defaultTTL: type: string type: object + config.WebConfig: + properties: + path: + type: string + type: object config.WebDAVConfig: properties: password: @@ -443,7 +477,6 @@ paths: type: string produces: - image/jpeg - - image/webp responses: "200": description: OK @@ -488,7 +521,6 @@ paths: type: string produces: - image/jpeg - - image/webp responses: "200": description: OK @@ -521,13 +553,12 @@ paths: name: variant type: string - default: jpg - description: 格式 (jpg, webp) + description: 格式 (jpg) in: query name: format type: string produces: - image/jpeg - - image/webp responses: "200": description: OK