From 7b9377eb21ac829ba29b9c467faed49381e43a81 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 19 Mar 2026 21:17:23 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=87=E6=A1=A3]=20=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 -------------- openflare_server/docs/docs.go | 37 +++++++++++++++++++++++++----- openflare_server/docs/swagger.json | 37 +++++++++++++++++++++++++----- openflare_server/docs/swagger.yaml | 20 +++++++++++++--- 4 files changed, 79 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 1dcdaeb6..2aef9cf7 100644 --- a/README.md +++ b/README.md @@ -112,12 +112,9 @@ services: DSN: postgres://openflare:replace-with-strong-password@postgres:5432/openflare?sslmode=disable GIN_MODE: release LOG_LEVEL: info - volumes: - - openflare-data:/data volumes: postgres-data: - openflare-data: ``` ```bash @@ -199,17 +196,6 @@ cd openflare_agent go run ./cmd/agent -config /path/to/agent.json ``` -## 文档导航 - -建议按以下顺序阅读: - -1. [docs/design.md](./docs/design.md) -2. [docs/development-guidelines.md](./docs/development-guidelines.md) -3. [docs/development-plan.md](./docs/development-plan.md) -4. [docs/frontend-development-guidelines.md](./docs/frontend-development-guidelines.md) -5. [docs/deployment.md](./docs/deployment.md) -6. [docs/app-config.md](./docs/app-config.md) - ## 管理端与接口 管理端当前覆盖: @@ -226,9 +212,6 @@ go run ./cmd/agent -config /path/to/agent.json 登录管理端后,可访问 Swagger UI:`/swagger/index.html` -如需重新生成 Swagger 文档,请使用与服务端依赖一致的版本: -`go install github.com/swaggo/swag/cmd/swag@v1.16.4` - ## 开源协议 本项目采用 [Apache License 2.0](./LICENSE) 开源。 diff --git a/openflare_server/docs/docs.go b/openflare_server/docs/docs.go index c32bf8d6..173ddda8 100644 --- a/openflare_server/docs/docs.go +++ b/openflare_server/docs/docs.go @@ -1442,6 +1442,34 @@ const docTemplate = `{ } } }, + "/api/option/database/cleanup": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Options" + ], + "summary": "Cleanup observability tables", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, "/api/option/geoip/lookup": { "post": { "consumes": [ @@ -2351,22 +2379,19 @@ const docTemplate = `{ "source_countries": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "status_codes": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "top_domains": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "unique_visitor_count": { diff --git a/openflare_server/docs/swagger.json b/openflare_server/docs/swagger.json index 203a5093..0e2b163e 100644 --- a/openflare_server/docs/swagger.json +++ b/openflare_server/docs/swagger.json @@ -1439,6 +1439,34 @@ } } }, + "/api/option/database/cleanup": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Options" + ], + "summary": "Cleanup observability tables", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, "/api/option/geoip/lookup": { "post": { "consumes": [ @@ -2348,22 +2376,19 @@ "source_countries": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "status_codes": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "top_domains": { "type": "object", "additionalProperties": { - "type": "integer", - "format": "int64" + "type": "integer" } }, "unique_visitor_count": { diff --git a/openflare_server/docs/swagger.yaml b/openflare_server/docs/swagger.yaml index 49ebfecf..aa431802 100644 --- a/openflare_server/docs/swagger.yaml +++ b/openflare_server/docs/swagger.yaml @@ -156,17 +156,14 @@ definitions: type: integer source_countries: additionalProperties: - format: int64 type: integer type: object status_codes: additionalProperties: - format: int64 type: integer type: object top_domains: additionalProperties: - format: int64 type: integer type: object unique_visitor_count: @@ -1178,6 +1175,23 @@ paths: summary: List editable options tags: - Options + /api/option/database/cleanup: + post: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: OK + schema: + additionalProperties: true + type: object + security: + - BearerAuth: [] + summary: Cleanup observability tables + tags: + - Options /api/option/geoip/lookup: post: consumes: