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