You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ch...@apache.org on 2020/10/13 12:09:45 UTC

[apisix-dashboard] branch refactor updated: fix: code style

This is an automated email from the ASF dual-hosted git repository.

chenjunxu pushed a commit to branch refactor
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/refactor by this push:
     new 5152b3a  fix: code style
5152b3a is described below

commit 5152b3aa6ac22bf3722cd581724e098ab3258234
Author: nic-chen <jo...@163.com>
AuthorDate: Tue Oct 13 20:09:17 2020 +0800

    fix: code style
---
 api/internal/core/store/query.go               | 2 +-
 api/internal/handler/consumer/consumer_test.go | 4 ++--
 api/internal/handler/route/route_test.go       | 2 +-
 api/internal/handler/service/service_test.go   | 2 +-
 api/internal/handler/ssl/ssl_test.go           | 2 +-
 api/internal/handler/upstream/upstream_test.go | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/api/internal/core/store/query.go b/api/internal/core/store/query.go
index 6ec53b2..88fe2ea 100644
--- a/api/internal/core/store/query.go
+++ b/api/internal/core/store/query.go
@@ -67,7 +67,7 @@ var NoFilter = &Filter{
 }
 
 type Pagination struct {
-	PageSize   int `json:"pageSize" form:"pageSize" auto_read:"pageSize"`
+	PageSize   int `json:"page_size" form:"page_size" auto_read:"page_size"`
 	PageNumber int `json:"page" form:"page" auto_read:"page"`
 }
 
diff --git a/api/internal/handler/consumer/consumer_test.go b/api/internal/handler/consumer/consumer_test.go
index 5291af2..3a3a43d 100644
--- a/api/internal/handler/consumer/consumer_test.go
+++ b/api/internal/handler/consumer/consumer_test.go
@@ -131,7 +131,7 @@ func TestConsumer(t *testing.T) {
 
 	//list page 1
 	listInput := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 1}`
+	reqBody = `{"page_size": 1, "page": 1}`
 	json.Unmarshal([]byte(reqBody), listInput)
 	ctx.SetInput(listInput)
 	retPage1, err := handler.List(ctx)
@@ -140,7 +140,7 @@ func TestConsumer(t *testing.T) {
 
 	//list page 2
 	listInput2 := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 2}`
+	reqBody = `{"page_size": 1, "page": 2}`
 	json.Unmarshal([]byte(reqBody), listInput2)
 	ctx.SetInput(listInput2)
 	retPage2, err := handler.List(ctx)
diff --git a/api/internal/handler/route/route_test.go b/api/internal/handler/route/route_test.go
index 33d48b8..5c7d0e3 100644
--- a/api/internal/handler/route/route_test.go
+++ b/api/internal/handler/route/route_test.go
@@ -747,7 +747,7 @@ func TestRoute(t *testing.T) {
 
 	//list
 	listInput := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 1}`
+	reqBody = `{"page_size": 1, "page": 1}`
 	json.Unmarshal([]byte(reqBody), listInput)
 	ctx.SetInput(listInput)
 	retPage, err := handler.List(ctx)
diff --git a/api/internal/handler/service/service_test.go b/api/internal/handler/service/service_test.go
index 86e098a..ffce7fc 100644
--- a/api/internal/handler/service/service_test.go
+++ b/api/internal/handler/service/service_test.go
@@ -109,7 +109,7 @@ func TestService(t *testing.T) {
 
 	//list
 	listInput := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 1}`
+	reqBody = `{"page_size": 1, "page": 1}`
 	json.Unmarshal([]byte(reqBody), listInput)
 	ctx.SetInput(listInput)
 	retPage, err := handler.List(ctx)
diff --git a/api/internal/handler/ssl/ssl_test.go b/api/internal/handler/ssl/ssl_test.go
index 9a8b341..d50208d 100644
--- a/api/internal/handler/ssl/ssl_test.go
+++ b/api/internal/handler/ssl/ssl_test.go
@@ -82,7 +82,7 @@ func TestSSL(t *testing.T) {
 
 	//list
 	listInput := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 1}`
+	reqBody = `{"page_size": 1, "page": 1}`
 	json.Unmarshal([]byte(reqBody), listInput)
 	ctx.SetInput(listInput)
 	retPage, err := handler.List(ctx)
diff --git a/api/internal/handler/upstream/upstream_test.go b/api/internal/handler/upstream/upstream_test.go
index b58e053..b774337 100644
--- a/api/internal/handler/upstream/upstream_test.go
+++ b/api/internal/handler/upstream/upstream_test.go
@@ -164,7 +164,7 @@ func TestUpstream(t *testing.T) {
 
 	//list
 	listInput := &ListInput{}
-	reqBody = `{"pageSize": 1, "page": 1}`
+	reqBody = `{"page_size": 1, "page": 1}`
 	json.Unmarshal([]byte(reqBody), listInput)
 	ctx.SetInput(listInput)
 	retPage, err := handler.List(ctx)