From dc1a672a334f26f1da5ed2e850b5487513847b41 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Wed, 16 Nov 2022 15:31:24 +0800 Subject: [PATCH] swagger --- docs/docs.go | 38 +++++++++++++++++++++++++++++++------- docs/swagger.json | 38 +++++++++++++++++++++++++++++++------- docs/swagger.yaml | 26 +++++++++++++++++++++----- 3 files changed, 83 insertions(+), 19 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 4403f136..ff29782a 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -3028,6 +3028,19 @@ const docTemplate = `{ "site" ], "summary": "get site legal info", + "parameters": [ + { + "enum": [ + "tos", + "privacy" + ], + "type": "string", + "description": "legal information type", + "name": "info_type", + "in": "query", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -3040,7 +3053,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/schema.SiteGeneralResp" + "$ref": "#/definitions/schema.GetSiteLegalInfoResp" } } } @@ -5094,6 +5107,23 @@ const docTemplate = `{ } } }, + "schema.GetSiteLegalInfoResp": { + "type": "object", + "properties": { + "privacy_policy_original_text": { + "type": "string" + }, + "privacy_policy_parsed_text": { + "type": "string" + }, + "terms_of_service_original_text": { + "type": "string" + }, + "terms_of_service_parsed_text": { + "type": "string" + } + } + }, "schema.GetTagPageResp": { "type": "object", "properties": { @@ -6000,9 +6030,6 @@ const docTemplate = `{ }, "schema.SiteWriteReq": { "type": "object", - "required": [ - "required_tag" - ], "properties": { "recommend_tags": { "type": "array", @@ -6023,9 +6050,6 @@ const docTemplate = `{ }, "schema.SiteWriteResp": { "type": "object", - "required": [ - "required_tag" - ], "properties": { "recommend_tags": { "type": "array", diff --git a/docs/swagger.json b/docs/swagger.json index 02db376c..d3eb7b90 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -3016,6 +3016,19 @@ "site" ], "summary": "get site legal info", + "parameters": [ + { + "enum": [ + "tos", + "privacy" + ], + "type": "string", + "description": "legal information type", + "name": "info_type", + "in": "query", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -3028,7 +3041,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/schema.SiteGeneralResp" + "$ref": "#/definitions/schema.GetSiteLegalInfoResp" } } } @@ -5082,6 +5095,23 @@ } } }, + "schema.GetSiteLegalInfoResp": { + "type": "object", + "properties": { + "privacy_policy_original_text": { + "type": "string" + }, + "privacy_policy_parsed_text": { + "type": "string" + }, + "terms_of_service_original_text": { + "type": "string" + }, + "terms_of_service_parsed_text": { + "type": "string" + } + } + }, "schema.GetTagPageResp": { "type": "object", "properties": { @@ -5988,9 +6018,6 @@ }, "schema.SiteWriteReq": { "type": "object", - "required": [ - "required_tag" - ], "properties": { "recommend_tags": { "type": "array", @@ -6011,9 +6038,6 @@ }, "schema.SiteWriteResp": { "type": "object", - "required": [ - "required_tag" - ], "properties": { "recommend_tags": { "type": "array", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a01dfe2b..36f8ef69 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -548,6 +548,17 @@ definitions: smtp_username: type: string type: object + schema.GetSiteLegalInfoResp: + properties: + privacy_policy_original_text: + type: string + privacy_policy_parsed_text: + type: string + terms_of_service_original_text: + type: string + terms_of_service_parsed_text: + type: string + type: object schema.GetTagPageResp: properties: created_at: @@ -1216,8 +1227,6 @@ definitions: items: type: string type: array - required: - - required_tag type: object schema.SiteWriteResp: properties: @@ -1231,8 +1240,6 @@ definitions: items: type: string type: array - required: - - required_tag type: object schema.TagItem: properties: @@ -3408,6 +3415,15 @@ paths: /answer/api/v1/siteinfo/legal: get: description: get site legal info + parameters: + - description: legal information type + enum: + - tos + - privacy + in: query + name: info_type + required: true + type: string produces: - application/json responses: @@ -3418,7 +3434,7 @@ paths: - $ref: '#/definitions/handler.RespBody' - properties: data: - $ref: '#/definitions/schema.SiteGeneralResp' + $ref: '#/definitions/schema.GetSiteLegalInfoResp' type: object summary: get site legal info tags: