This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a commit to branch feat-server_info in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
commit 7d5593ff8f8036cb32c3f7cbc6b1567ad2ba4013 Author: juzhiyuan <[email protected]> AuthorDate: Sat Dec 19 12:25:11 2020 +0800 feat: put server_info under the admin api --- api/internal/handler/server_info/server_info.go | 4 ++-- api/test/e2e/server_info_test.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/internal/handler/server_info/server_info.go b/api/internal/handler/server_info/server_info.go index 23ead6d..0b3f529 100644 --- a/api/internal/handler/server_info/server_info.go +++ b/api/internal/handler/server_info/server_info.go @@ -41,9 +41,9 @@ func NewHandler() (handler.RouteRegister, error) { } func (h *Handler) ApplyRoute(r *gin.Engine) { - r.GET("/apisix/server_info/:id", wgin.Wraps(h.Get, + r.GET("/apisix/admin/server_info/:id", wgin.Wraps(h.Get, wrapper.InputType(reflect.TypeOf(GetInput{})))) - r.GET("/apisix/server_info", wgin.Wraps(h.List, + r.GET("/apisix/admin/server_info", wgin.Wraps(h.List, wrapper.InputType(reflect.TypeOf(ListInput{})))) } diff --git a/api/test/e2e/server_info_test.go b/api/test/e2e/server_info_test.go index 8e2f069..bbe9c50 100644 --- a/api/test/e2e/server_info_test.go +++ b/api/test/e2e/server_info_test.go @@ -29,7 +29,7 @@ func TestServerInfo_Get(t *testing.T) { { caseDesc: "get server info", Object: ManagerApiExpect(t), - Path: "/apisix/server_info/apisix-server1", + Path: "/apisix/admin/server_info/apisix-server1", Method: http.MethodGet, Headers: map[string]string{"Authorization": token}, ExpectStatus: http.StatusOK, @@ -38,7 +38,7 @@ func TestServerInfo_Get(t *testing.T) { { caseDesc: "get server info", Object: ManagerApiExpect(t), - Path: "/apisix/server_info/apisix-server2", + Path: "/apisix/admin/server_info/apisix-server2", Method: http.MethodGet, Headers: map[string]string{"Authorization": token}, ExpectStatus: http.StatusOK, @@ -56,7 +56,7 @@ func TestServerInfo_List(t *testing.T) { { caseDesc: "list all server info", Object: ManagerApiExpect(t), - Path: "/apisix/server_info", + Path: "/apisix/admin/server_info", Method: http.MethodGet, Headers: map[string]string{"Authorization": token}, ExpectStatus: http.StatusOK, @@ -65,7 +65,7 @@ func TestServerInfo_List(t *testing.T) { { caseDesc: "list server info with hostname", Object: ManagerApiExpect(t), - Path: "/apisix/server_info", + Path: "/apisix/admin/server_info", Query: "hostname=apisix_", Method: http.MethodGet, Headers: map[string]string{"Authorization": token}, @@ -75,7 +75,7 @@ func TestServerInfo_List(t *testing.T) { { caseDesc: "list server info with hostname", Object: ManagerApiExpect(t), - Path: "/apisix/server_info", + Path: "/apisix/admin/server_info", Query: "hostname=apisix_server2", Method: http.MethodGet, Headers: map[string]string{"Authorization": token},
