This commit is contained in:
15
docs/docs.go
15
docs/docs.go
@@ -472,7 +472,7 @@ const docTemplate = `{
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Response-User"
|
||||
"$ref": "#/definitions/Response-Rank"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
@@ -663,6 +663,19 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"Response-Rank": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"description": "Data contains the actual response payload",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Rank"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Response-Time": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Response-User"
|
||||
"$ref": "#/definitions/Response-Rank"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
@@ -656,6 +656,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Response-Rank": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"description": "Data contains the actual response payload",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Rank"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Response-Time": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -107,6 +107,13 @@ definitions:
|
||||
- $ref: '#/definitions/Map'
|
||||
description: Data contains the actual response payload
|
||||
type: object
|
||||
Response-Rank:
|
||||
properties:
|
||||
data:
|
||||
allOf:
|
||||
- $ref: '#/definitions/Rank'
|
||||
description: Data contains the actual response payload
|
||||
type: object
|
||||
Response-Time:
|
||||
properties:
|
||||
data:
|
||||
@@ -454,7 +461,7 @@ paths:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/Response-User'
|
||||
$ref: '#/definitions/Response-Rank'
|
||||
"404":
|
||||
description: User not found
|
||||
schema:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package public_api
|
||||
|
||||
//go:generate swag init -g ./cmd/public-api/serve.go
|
||||
//go:generate swag init -g ./cmd/public-api/service.go
|
||||
|
||||
@@ -88,7 +88,7 @@ func (h *UserHandler) Get(ctx *gin.Context) {
|
||||
// @Security ApiKeyAuth
|
||||
// @Param id path int true "User ID"
|
||||
// @Param filter query dto.RankFilter false "Rank query parameters"
|
||||
// @Success 200 {object} dto.Response[dto.User]
|
||||
// @Success 200 {object} dto.Response[dto.Rank]
|
||||
// @Failure 404 {object} dto.Error "User not found"
|
||||
// @Failure default {object} dto.Error "General error response"
|
||||
// @Router /user/{id}/rank [get]
|
||||
@@ -137,7 +137,7 @@ func (h *UserHandler) GetRank(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Convert gRPC UserResponse object to dto.UserData object
|
||||
// Convert gRPC Rank object to dto.Rank object
|
||||
var rank dto.Rank
|
||||
result := rank.FromGRPC(rankItem)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user