doc: generate swagger doc

This commit is contained in:
LinkinStar 2022-11-15 17:12:33 +08:00
parent b473a9e62a
commit 4b7b40152b
3 changed files with 126 additions and 12 deletions

View File

@ -3018,6 +3018,38 @@ const docTemplate = `{
}
}
},
"/answer/api/v1/siteinfo/legal": {
"get": {
"description": "get site legal info",
"produces": [
"application/json"
],
"tags": [
"site"
],
"summary": "get site legal info",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.SiteGeneralResp"
}
}
}
]
}
}
}
}
},
"/answer/api/v1/tag": {
"get": {
"description": "get tag one",
@ -5911,10 +5943,16 @@ const docTemplate = `{
"schema.SiteLegalReq": {
"type": "object",
"properties": {
"privacy_policy": {
"privacy_policy_original_text": {
"type": "string"
},
"terms_of_service": {
"privacy_policy_parsed_text": {
"type": "string"
},
"terms_of_service_original_text": {
"type": "string"
},
"terms_of_service_parsed_text": {
"type": "string"
}
}
@ -5922,10 +5960,16 @@ const docTemplate = `{
"schema.SiteLegalResp": {
"type": "object",
"properties": {
"privacy_policy": {
"privacy_policy_original_text": {
"type": "string"
},
"terms_of_service": {
"privacy_policy_parsed_text": {
"type": "string"
},
"terms_of_service_original_text": {
"type": "string"
},
"terms_of_service_parsed_text": {
"type": "string"
}
}

View File

@ -3006,6 +3006,38 @@
}
}
},
"/answer/api/v1/siteinfo/legal": {
"get": {
"description": "get site legal info",
"produces": [
"application/json"
],
"tags": [
"site"
],
"summary": "get site legal info",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.SiteGeneralResp"
}
}
}
]
}
}
}
}
},
"/answer/api/v1/tag": {
"get": {
"description": "get tag one",
@ -5899,10 +5931,16 @@
"schema.SiteLegalReq": {
"type": "object",
"properties": {
"privacy_policy": {
"privacy_policy_original_text": {
"type": "string"
},
"terms_of_service": {
"privacy_policy_parsed_text": {
"type": "string"
},
"terms_of_service_original_text": {
"type": "string"
},
"terms_of_service_parsed_text": {
"type": "string"
}
}
@ -5910,10 +5948,16 @@
"schema.SiteLegalResp": {
"type": "object",
"properties": {
"privacy_policy": {
"privacy_policy_original_text": {
"type": "string"
},
"terms_of_service": {
"privacy_policy_parsed_text": {
"type": "string"
},
"terms_of_service_original_text": {
"type": "string"
},
"terms_of_service_parsed_text": {
"type": "string"
}
}

View File

@ -1168,16 +1168,24 @@ definitions:
type: object
schema.SiteLegalReq:
properties:
privacy_policy:
privacy_policy_original_text:
type: string
terms_of_service:
privacy_policy_parsed_text:
type: string
terms_of_service_original_text:
type: string
terms_of_service_parsed_text:
type: string
type: object
schema.SiteLegalResp:
properties:
privacy_policy:
privacy_policy_original_text:
type: string
terms_of_service:
privacy_policy_parsed_text:
type: string
terms_of_service_original_text:
type: string
terms_of_service_parsed_text:
type: string
type: object
schema.SiteWriteReq:
@ -3379,6 +3387,24 @@ paths:
summary: get site info
tags:
- site
/answer/api/v1/siteinfo/legal:
get:
description: get site legal info
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteGeneralResp'
type: object
summary: get site legal info
tags:
- site
/answer/api/v1/tag:
delete:
consumes: