bugfix
This commit is contained in:
parent
e691640055
commit
c38afc6ef3
@ -29,7 +29,7 @@ func NewAPIHandler(app *logic.Application) APIHandler {
|
||||
// @Router /server [GET]
|
||||
func (h APIHandler) ListServer(pctx ginext.PreContext) ginext.HTTPResponse {
|
||||
type response struct {
|
||||
Server []models.Server `json:"server"`
|
||||
Servers []models.Server `json:"servers"`
|
||||
}
|
||||
|
||||
ctx, _, errResp := pctx.Start()
|
||||
@ -43,5 +43,5 @@ func (h APIHandler) ListServer(pctx ginext.PreContext) ginext.HTTPResponse {
|
||||
return ginext.Error(err)
|
||||
}
|
||||
|
||||
return ginext.JSON(http.StatusOK, response{Server: srvs})
|
||||
return ginext.JSON(http.StatusOK, response{Servers: srvs})
|
||||
}
|
||||
|
@ -225,7 +225,7 @@
|
||||
"handler.ListServer.response": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"server": {
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.Server"
|
||||
|
@ -7,7 +7,7 @@ definitions:
|
||||
type: object
|
||||
handler.ListServer.response:
|
||||
properties:
|
||||
server:
|
||||
servers:
|
||||
items:
|
||||
$ref: '#/definitions/models.Server'
|
||||
type: array
|
||||
|
Loading…
Reference in New Issue
Block a user