From f7667bcc76032cc77ec19351728b0a1f0572e6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 23 Jun 2024 14:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- request.go | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/request.go b/request.go index 34b3f25..9f69f7c 100644 --- a/request.go +++ b/request.go @@ -8,16 +8,37 @@ package consts const ( - RequestLocationHeader = "HEADER" // header - RequestLocationCookie = "COOKIE" // cookie - RequestLocationBody = "BODY" // body - RequestLocationQuery = "QUERY" // query - RequestLocationUriPath = "URI_PATH" // uri路由一部分 + RequestDataLocationHeader = "HEADER" // header + RequestDataLocationCookie = "COOKIE" // cookie + RequestDataLocationBody = "BODY" // body + RequestDataLocationQuery = "QUERY" // query + RequestDataLocationUriPath = "URI_PATH" // uri路由一部分 ) const ( - ResponseLocationHeader = "HEADER" // header - ResponseLocationCookie = "COOKIE" // cookie - ResponseLocationBody = "BODY" // body - ResponseLocationExtension = "EXTENSION" // 扩展信息 + ResponseDataLocationHeader = "HEADER" // header + ResponseDataLocationCookie = "COOKIE" // cookie + ResponseDataLocationBody = "BODY" // body + ResponseDataLocationExtension = "EXTENSION" // 扩展信息 +) + +type DataLocationDesc struct { + Value string `json:"value"` // 数据位置 + Description string `json:"description"` // 数据位置描述 +} + +var ( + RequestDataLocationList = []DataLocationDesc{ + {Value: RequestDataLocationHeader, Description: "请求header"}, + {Value: RequestDataLocationCookie, Description: "请求cookie"}, + {Value: RequestDataLocationBody, Description: "请求body"}, + {Value: RequestDataLocationQuery, Description: "请求query"}, + {Value: RequestDataLocationUriPath, Description: "请求uri_path"}, + } + ResponseDataLocationList = []DataLocationDesc{ + {Value: ResponseDataLocationHeader, Description: "响应header"}, + {Value: ResponseDataLocationCookie, Description: "响应cookie"}, + {Value: ResponseDataLocationBody, Description: "响应body"}, + {Value: ResponseDataLocationExtension, Description: "响应扩展数据"}, + } )