Skip to content

Commit

Permalink
fix(embed): embed plugin type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Aug 19, 2024
1 parent 8315578 commit 1d9f88f
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 107 deletions.
90 changes: 68 additions & 22 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,7 @@ const docTemplate = `{
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetEmbedOptionResp"
"$ref": "#/definitions/plugin.EmbedConfig"
}
}
}
Expand Down Expand Up @@ -4410,7 +4410,7 @@ const docTemplate = `{
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetTagResp"
"$ref": "#/definitions/schema.GetTagBasicResp"
}
}
}
Expand Down Expand Up @@ -5380,7 +5380,7 @@ const docTemplate = `{
},
"/answer/api/v1/tags": {
"get": {
"description": "get tags list",
"description": "get tags list by slug name",
"produces": [
"application/json"
],
Expand All @@ -5404,7 +5404,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.RespBody"
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetTagBasicResp"
}
}
}
}
]
}
}
}
Expand Down Expand Up @@ -6571,14 +6586,14 @@ const docTemplate = `{
},
"/custom.css": {
"get": {
"description": "get site robots information",
"description": "get site custom CSS",
"produces": [
"application/json"
"text/css"
],
"tags": [
"site"
],
"summary": "get site robots information",
"summary": "get site custom CSS",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -7004,6 +7019,17 @@ const docTemplate = `{
"list": {}
}
},
"plugin.EmbedConfig": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"platform": {
"type": "string"
}
}
},
"schema.AcceptAnswerReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -7813,17 +7839,6 @@ const docTemplate = `{
}
}
},
"schema.GetEmbedOptionResp": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"platform": {
"type": "string"
}
}
},
"schema.GetFollowingTagsResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8242,6 +8257,23 @@ const docTemplate = `{
}
}
},
"schema.GetTagBasicResp": {
"type": "object",
"properties": {
"display_name": {
"type": "string"
},
"recommend": {
"type": "boolean"
},
"reserved": {
"type": "boolean"
},
"slug_name": {
"type": "string"
}
}
},
"schema.GetTagPageResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -9819,7 +9851,7 @@ const docTemplate = `{
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9828,7 +9860,7 @@ const docTemplate = `{
"reserved_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"restrict_answer": {
Expand All @@ -9842,7 +9874,7 @@ const docTemplate = `{
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9851,14 +9883,28 @@ const docTemplate = `{
"reserved_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"restrict_answer": {
"type": "boolean"
}
}
},
"schema.SiteWriteTag": {
"type": "object",
"required": [
"slug_name"
],
"properties": {
"display_name": {
"type": "string"
},
"slug_name": {
"type": "string"
}
}
},
"schema.TagItem": {
"type": "object",
"properties": {
Expand Down
92 changes: 69 additions & 23 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetEmbedOptionResp"
"$ref": "#/definitions/plugin.EmbedConfig"
}
}
}
Expand Down Expand Up @@ -4380,7 +4380,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetTagResp"
"$ref": "#/definitions/schema.GetTagBasicResp"
}
}
}
Expand Down Expand Up @@ -5350,7 +5350,7 @@
},
"/answer/api/v1/tags": {
"get": {
"description": "get tags list",
"description": "get tags list by slug name",
"produces": [
"application/json"
],
Expand All @@ -5374,7 +5374,22 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.RespBody"
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetTagBasicResp"
}
}
}
}
]
}
}
}
Expand Down Expand Up @@ -6541,14 +6556,14 @@
},
"/custom.css": {
"get": {
"description": "get site robots information",
"description": "get site custom CSS",
"produces": [
"application/json"
"text/css"
],
"tags": [
"site"
],
"summary": "get site robots information",
"summary": "get site custom CSS",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -6974,6 +6989,17 @@
"list": {}
}
},
"plugin.EmbedConfig": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"platform": {
"type": "string"
}
}
},
"schema.AcceptAnswerReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -7783,17 +7809,6 @@
}
}
},
"schema.GetEmbedOptionResp": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"platform": {
"type": "string"
}
}
},
"schema.GetFollowingTagsResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8212,6 +8227,23 @@
}
}
},
"schema.GetTagBasicResp": {
"type": "object",
"properties": {
"display_name": {
"type": "string"
},
"recommend": {
"type": "boolean"
},
"reserved": {
"type": "boolean"
},
"slug_name": {
"type": "string"
}
}
},
"schema.GetTagPageResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8809,7 +8841,7 @@
"enum": [
"newest",
"active",
"frequent",
"hot",
"score",
"unanswered"
]
Expand Down Expand Up @@ -9789,7 +9821,7 @@
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9798,7 +9830,7 @@
"reserved_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"restrict_answer": {
Expand All @@ -9812,7 +9844,7 @@
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9821,14 +9853,28 @@
"reserved_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"restrict_answer": {
"type": "boolean"
}
}
},
"schema.SiteWriteTag": {
"type": "object",
"required": [
"slug_name"
],
"properties": {
"display_name": {
"type": "string"
},
"slug_name": {
"type": "string"
}
}
},
"schema.TagItem": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 1d9f88f

Please sign in to comment.