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": { "/answer/api/v1/tag": {
"get": { "get": {
"description": "get tag one", "description": "get tag one",
@ -5911,10 +5943,16 @@ const docTemplate = `{
"schema.SiteLegalReq": { "schema.SiteLegalReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"privacy_policy": { "privacy_policy_original_text": {
"type": "string" "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": "string"
} }
} }
@ -5922,10 +5960,16 @@ const docTemplate = `{
"schema.SiteLegalResp": { "schema.SiteLegalResp": {
"type": "object", "type": "object",
"properties": { "properties": {
"privacy_policy": { "privacy_policy_original_text": {
"type": "string" "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": "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": { "/answer/api/v1/tag": {
"get": { "get": {
"description": "get tag one", "description": "get tag one",
@ -5899,10 +5931,16 @@
"schema.SiteLegalReq": { "schema.SiteLegalReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"privacy_policy": { "privacy_policy_original_text": {
"type": "string" "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": "string"
} }
} }
@ -5910,10 +5948,16 @@
"schema.SiteLegalResp": { "schema.SiteLegalResp": {
"type": "object", "type": "object",
"properties": { "properties": {
"privacy_policy": { "privacy_policy_original_text": {
"type": "string" "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": "string"
} }
} }

View File

@ -1168,16 +1168,24 @@ definitions:
type: object type: object
schema.SiteLegalReq: schema.SiteLegalReq:
properties: properties:
privacy_policy: privacy_policy_original_text:
type: string 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: string
type: object type: object
schema.SiteLegalResp: schema.SiteLegalResp:
properties: properties:
privacy_policy: privacy_policy_original_text:
type: string 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: string
type: object type: object
schema.SiteWriteReq: schema.SiteWriteReq:
@ -3379,6 +3387,24 @@ paths:
summary: get site info summary: get site info
tags: tags:
- site - 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: /answer/api/v1/tag:
delete: delete:
consumes: consumes: