diff --git a/pkg/common/common.go b/pkg/common/common.go index 4f2f34af..9dad60a1 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -27,8 +27,8 @@ const ( QueryParamRev = "revision" QueryParamMatch = "match" QueryParamKeyID = "kv_id" - QueryLimit = "limit" - QueryOffset = "offset" + QueryPageNum = "pageNum" + QueryPageSize = "pageSize" ) //http headers diff --git a/server/resource/v1/doc_struct.go b/server/resource/v1/doc_struct.go index b8de013b..e8756bb0 100644 --- a/server/resource/v1/doc_struct.go +++ b/server/resource/v1/doc_struct.go @@ -89,17 +89,17 @@ var ( ParamType: goRestful.QueryParameterKind, Desc: "label pairs,for example &label=service:order&label=version:1.0.0", } - DocQueryLimitParameters = &restful.Parameters{ + DocQueryPageNumParameters = &restful.Parameters{ DataType: "string", - Name: common.QueryLimit, + Name: common.QueryPageNum, ParamType: goRestful.QueryParameterKind, - Desc: "limit,for example &limit=10", + Desc: "pageNum,for example &pageNum=10", } - DocQueryOffsetParameters = &restful.Parameters{ + DocQueryPageSizeParameters = &restful.Parameters{ DataType: "string", - Name: common.QueryOffset, + Name: common.QueryPageSize, ParamType: goRestful.QueryParameterKind, - Desc: "offset,for example &offset=10", + Desc: "PageSize,for example &pageSize=10", } ) diff --git a/server/resource/v1/history_resource.go b/server/resource/v1/history_resource.go index 98a6397c..d42d28a1 100644 --- a/server/resource/v1/history_resource.go +++ b/server/resource/v1/history_resource.go @@ -129,13 +129,13 @@ func (r *HistoryResource) URLPatterns() []restful.Route { ResourceFunc: r.GetPollingData, FuncDesc: "get all history record of get and list", Parameters: []*restful.Parameters{ - DocPathProject, DocPathKeyID, + DocPathProject, }, Returns: []*restful.Returns{ { Code: http.StatusOK, Message: "true", - Model: []model.KVDoc{}, + Model: []model.PollingDetail{}, }, }, Consumes: []string{goRestful.MIME_JSON, common.ContentTypeYaml}, diff --git a/server/resource/v1/history_resource_test.go b/server/resource/v1/history_resource_test.go index d0ac140e..973aa0af 100644 --- a/server/resource/v1/history_resource_test.go +++ b/server/resource/v1/history_resource_test.go @@ -113,7 +113,7 @@ func TestHistoryResource_GetPollingData(t *testing.T) { assert.Equal(t, kv.Labels, data.Labels) }) t.Run("get polling data", func(t *testing.T) { - r, _ := http.NewRequest("GET", "/v1/test/kie/kv/record?instanceId=test&domain=default", nil) + r, _ := http.NewRequest("GET", "/v1/test/kie/record?instanceId=test&domain=default", nil) noopH := &handler2.NoopAuthHandler{} chain, _ := handler.CreateChain(common.Provider, "testchain1", noopH.Name()) r.Header.Set("Content-Type", "application/json")