From b16e42981bb2a041b43400d83d6672cbf2692449 Mon Sep 17 00:00:00 2001 From: zyl <2025320615@qq.com> Date: Sat, 26 Dec 2020 11:15:14 +0800 Subject: [PATCH] =?UTF-8?q?#79=20=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.sum | 2 ++ pkg/common/common.go | 1 + server/resource/v1/history_resource.go | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/go.sum b/go.sum index 613b0c63..6d39ae31 100644 --- a/go.sum +++ b/go.sum @@ -434,6 +434,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -600,6 +601,7 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/common/common.go b/pkg/common/common.go index 097a2b1c..483e6f86 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -35,6 +35,7 @@ const ( PathParameterProject = "project" //polling data QueryParamSessionID = "sessionId" + QueryParamSessionGroup = "sessionGroup" QueryParamIP = "ip" QueryParamURLPath = "urlPath" QueryParamUserAgent = "userAgent" diff --git a/server/resource/v1/history_resource.go b/server/resource/v1/history_resource.go index ed80d978..acf7fb1b 100644 --- a/server/resource/v1/history_resource.go +++ b/server/resource/v1/history_resource.go @@ -72,6 +72,14 @@ func (r *HistoryResource) GetPollingData(context *restful.Context) { if sessionID != "" { query.SessionID = sessionID } + sessionCroup := context.ReadQueryParameter(common.QueryParamSessionGroup) + if sessionCroup != "" { + query.SessionGroup = sessionCroup + } + revision := context.ReadQueryParameter(common.QueryParamRev) + if revision != "" { + query.Revision = revision + } ip := context.ReadQueryParameter(common.QueryParamIP) if ip != "" { query.IP = ip