Skip to content

Commit

Permalink
[fix] #34 Issueの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Feb 20, 2021
1 parent a2de50a commit b5fe8b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkg/api/core/common/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ package common
type Error struct {
Error string `json:"error"`
}

type Result struct {
Result string `json:"result"`
}
2 changes: 1 addition & 1 deletion pkg/api/core/group/connection/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Connection struct {
}

type Result struct {
ConnectionData []Connection `json:"data"`
Connection []Connection `json:"connection"`
}

type ResultDatabase struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/core/group/connection/v0/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func GetAdmin(c *gin.Context) {
c.JSON(http.StatusInternalServerError, common.Error{Error: result.Err.Error()})
return
}
c.JSON(http.StatusOK, connection.Result{ConnectionData: result.Connection})
c.JSON(http.StatusOK, connection.Result{Connection: result.Connection})
}

func GetAllAdmin(c *gin.Context) {
Expand All @@ -142,6 +142,6 @@ func GetAllAdmin(c *gin.Context) {
if result := dbConnection.GetAll(); result.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: result.Err.Error()})
} else {
c.JSON(http.StatusOK, connection.Result{ConnectionData: result.Connection})
c.JSON(http.StatusOK, connection.Result{Connection: result.Connection})
}
}

0 comments on commit b5fe8b5

Please sign in to comment.