From 4743b2edb734f567bad9cd4c691a7df93167db92 Mon Sep 17 00:00:00 2001 From: GuoYL Date: Sat, 29 Feb 2020 14:13:45 +0800 Subject: [PATCH] #79 modify --- server/resource/v1/history_resource.go | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/server/resource/v1/history_resource.go b/server/resource/v1/history_resource.go index ac21e4a1..a3b1f446 100644 --- a/server/resource/v1/history_resource.go +++ b/server/resource/v1/history_resource.go @@ -75,11 +75,22 @@ func (r *HistoryResource) GetRevisions(context *restful.Context) { //GetPollingData get the record of the get or list history func (r *HistoryResource) GetPollingData(context *restful.Context) { - query := &model.PollingDetail{ - SessionID: context.ReadQueryParameter("sessionId"), - IP: context.ReadQueryParameter("ip"), - URLPath: context.ReadQueryParameter("urlPath"), - UserAgent: context.ReadQueryParameter("userAgent"), + query := &model.PollingDetail{} + sessionId := context.ReadQueryParameter("sessionId") + if sessionId != "" { + query.SessionID = sessionId + } + ip := context.ReadQueryParameter("ip") + if ip != "" { + query.IP = ip + } + urlPath := context.ReadQueryParameter("urlPath") + if urlPath != "" { + query.URLPath = urlPath + } + userAgent := context.ReadQueryParameter("userAgent") + if userAgent != "" { + query.UserAgent = userAgent } domain := ReadDomain(context) if domain == nil {