Skip to content

Commit

Permalink
feat(badge): define func and add badge's list
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Aug 7, 2024
1 parent d055507 commit ea43edc
Show file tree
Hide file tree
Showing 20 changed files with 975 additions and 82 deletions.
11 changes: 10 additions & 1 deletion cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

137 changes: 130 additions & 7 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,49 @@ const docTemplate = `{
}
}
},
"/answer/api/v1/badges": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "list all badges group by group",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"api-badge"
],
"summary": "list all badges group by group",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetBadgeListResp"
}
}
}
}
]
}
}
}
}
},
"/answer/api/v1/collection/switch": {
"post": {
"security": [
Expand Down Expand Up @@ -4410,7 +4453,7 @@ const docTemplate = `{
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetTagResp"
"$ref": "#/definitions/schema.GetTagBasicResp"
}
}
}
Expand Down Expand Up @@ -5380,7 +5423,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 +5447,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 @@ -7327,6 +7385,26 @@ const docTemplate = `{
}
}
},
"schema.BadgeListInfo": {
"type": "object",
"properties": {
"award_count": {
"type": "integer"
},
"earned": {
"type": "boolean"
},
"icon": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"schema.CloseQuestionReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -7578,6 +7656,20 @@ const docTemplate = `{
}
}
},
"schema.GetBadgeListResp": {
"type": "object",
"properties": {
"badges": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.BadgeListInfo"
}
},
"group_name": {
"type": "string"
}
}
},
"schema.GetCommentPersonalWithPageResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8242,6 +8334,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 +9928,7 @@ const docTemplate = `{
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9828,7 +9937,7 @@ const docTemplate = `{
"reserved_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"restrict_answer": {
Expand All @@ -9842,7 +9951,7 @@ const docTemplate = `{
"recommend_tags": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/schema.SiteWriteTag"
}
},
"required_tag": {
Expand All @@ -9851,14 +9960,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
Loading

0 comments on commit ea43edc

Please sign in to comment.