Skip to content

Commit

Permalink
feat(badge): badge manage and user center's badge list
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Aug 13, 2024
1 parent 290f63f commit bb40366
Show file tree
Hide file tree
Showing 15 changed files with 806 additions and 16 deletions.
3 changes: 2 additions & 1 deletion cmd/wire_gen.go

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

188 changes: 188 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,113 @@ const docTemplate = `{
}
}
},
"/answer/admin/api/badge/status": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "update badge status",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"AdminBadge"
],
"summary": "update badge status",
"parameters": [
{
"description": "UpdateBadgeStatusReq",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.UpdateBadgeStatusReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.RespBody"
}
}
}
}
},
"/answer/admin/api/badges": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "list all badges by page",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"AdminBadge"
],
"summary": "list all badges by page",
"parameters": [
{
"type": "integer",
"description": "page",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "page size",
"name": "page_size",
"in": "query"
},
{
"enum": [
"",
"active",
"inactive"
],
"type": "string",
"description": "badge status",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.GetBadgeListPagedResp"
}
}
}
}
]
}
}
}
}
},
"/answer/admin/api/dashboard": {
"get": {
"security": [
Expand Down Expand Up @@ -7652,6 +7759,17 @@ const docTemplate = `{
}
}
},
"schema.BadgeStatus": {
"type": "string",
"enum": [
"active",
"inactive"
],
"x-enum-varnames": [
"BadgeStatusActive",
"BadgeStatusInactive"
]
},
"schema.CloseQuestionReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -7944,6 +8062,55 @@ const docTemplate = `{
}
}
},
"schema.GetBadgeListPagedResp": {
"type": "object",
"properties": {
"award_count": {
"description": "badge award count",
"type": "integer"
},
"description": {
"description": "badge description",
"type": "string"
},
"earned": {
"description": "badge earned count",
"type": "boolean"
},
"group_name": {
"description": "badge group name",
"type": "string"
},
"icon": {
"description": "badge icon",
"type": "string"
},
"id": {
"description": "badge id",
"type": "string"
},
"level": {
"description": "badge level",
"allOf": [
{
"$ref": "#/definitions/entity.BadgeLevel"
}
]
},
"name": {
"description": "badge name",
"type": "string"
},
"status": {
"description": "badge status",
"allOf": [
{
"$ref": "#/definitions/schema.BadgeStatus"
}
]
}
}
},
"schema.GetBadgeListResp": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10446,6 +10613,27 @@ const docTemplate = `{
}
}
},
"schema.UpdateBadgeStatusReq": {
"type": "object",
"required": [
"id",
"status"
],
"properties": {
"id": {
"description": "badge id",
"type": "string"
},
"status": {
"description": "badge status",
"allOf": [
{
"$ref": "#/definitions/schema.BadgeStatus"
}
]
}
}
},
"schema.UpdateCommentReq": {
"type": "object",
"required": [
Expand Down
Loading

0 comments on commit bb40366

Please sign in to comment.