Fix event list response the hole result struct
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -19,15 +19,15 @@ import (
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security Bearer
|
||||
// @Param limit query int false "Maximum number of events to return (default 20)"
|
||||
// @Param offset query int true "Number of events to skip"
|
||||
// @Param type query string false "Filter by event type: 'official' or 'party'"
|
||||
// @Param sort_by query string false "Sort field: 'start_time' (default), 'end_time', 'name'"
|
||||
// @Param sort_order query string false "Sort direction: 'asc' or 'desc' (default)"
|
||||
// @Success 200 {object} utils.RespStatus{data=service_event.EventListResponse} "Successful paginated list retrieval"
|
||||
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
|
||||
// @Failure 401 {object} utils.RespStatus{data=nil} "Unauthorized"
|
||||
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error"
|
||||
// @Param limit query int false "Maximum number of events to return (default 20)"
|
||||
// @Param offset query int true "Number of events to skip"
|
||||
// @Param type query string false "Filter by event type: 'official' or 'party'"
|
||||
// @Param sort_by query string false "Sort field: 'start_time' (default), 'end_time', 'name'"
|
||||
// @Param sort_order query string false "Sort direction: 'asc' or 'desc' (default)"
|
||||
// @Success 200 {object} utils.RespStatus{data=service_event.EventListResponse} "Successful paginated list retrieval"
|
||||
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
|
||||
// @Failure 401 {object} utils.RespStatus{data=nil} "Unauthorized"
|
||||
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error"
|
||||
// @Router /event/list [get]
|
||||
func (self *EventHandler) List(c *gin.Context) {
|
||||
ctx, span := tracer.StartSpan(
|
||||
@@ -114,5 +114,5 @@ func (self *EventHandler) List(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
utils.HttpResponse(c, result.Common.HttpCode, result.Common.Exception.String(), result)
|
||||
utils.HttpResponse(c, result.Common.HttpCode, result.Common.Exception.String(), result.Data)
|
||||
}
|
||||
|
||||
27
docs/docs.go
27
docs/docs.go
@@ -2424,10 +2424,7 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/service_event.EventListResponse"
|
||||
}
|
||||
"$ref": "#/definitions/service_event.EventListResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4080,7 +4077,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventListResponse": {
|
||||
"service_event.EventListItems": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enable_kyc",
|
||||
@@ -4133,6 +4130,20 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/service_event.EventListItems"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4168,9 +4179,15 @@ const docTemplate = `{
|
||||
"is_agenda_published": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"quota": {
|
||||
"type": "integer"
|
||||
},
|
||||
"start_time": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -2422,10 +2422,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/service_event.EventListResponse"
|
||||
}
|
||||
"$ref": "#/definitions/service_event.EventListResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4078,7 +4075,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventListResponse": {
|
||||
"service_event.EventListItems": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enable_kyc",
|
||||
@@ -4131,6 +4128,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/service_event.EventListItems"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"service_event.EventStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4166,9 +4177,15 @@
|
||||
"is_agenda_published": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"quota": {
|
||||
"type": "integer"
|
||||
},
|
||||
"start_time": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -293,7 +293,7 @@ definitions:
|
||||
required:
|
||||
- attendance_id
|
||||
type: object
|
||||
service_event.EventListResponse:
|
||||
service_event.EventListItems:
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
@@ -330,6 +330,15 @@ definitions:
|
||||
- subtitle
|
||||
- type
|
||||
type: object
|
||||
service_event.EventListResponse:
|
||||
properties:
|
||||
items:
|
||||
items:
|
||||
$ref: '#/definitions/service_event.EventListItems'
|
||||
type: array
|
||||
total:
|
||||
type: integer
|
||||
type: object
|
||||
service_event.EventStatsResponse:
|
||||
properties:
|
||||
agenda_submission_count:
|
||||
@@ -353,8 +362,12 @@ definitions:
|
||||
type: string
|
||||
is_agenda_published:
|
||||
type: boolean
|
||||
limit:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
quota:
|
||||
type: integer
|
||||
start_time:
|
||||
type: string
|
||||
subtitle:
|
||||
@@ -1816,9 +1829,7 @@ paths:
|
||||
- $ref: '#/definitions/utils.RespStatus'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/service_event.EventListResponse'
|
||||
type: array
|
||||
$ref: '#/definitions/service_event.EventListResponse'
|
||||
type: object
|
||||
"400":
|
||||
description: Invalid Input
|
||||
|
||||
Reference in New Issue
Block a user