修复参数构建 + 验证相关一系列BUG
This commit is contained in:
@ -15,23 +15,24 @@ import "context"
|
||||
//
|
||||
// Date : 17:10 2024/5/24
|
||||
type Request struct {
|
||||
Ctx context.Context `json:"-"` // 请求上下文
|
||||
PathParam map[string]string `json:"path_param"` // 替换url中的占位符
|
||||
Body map[string]any `json:"body"` // 请求Body
|
||||
Header map[string]any `json:"header"` // 请求Header
|
||||
Cookie map[string]any `json:"cookie"` // 请求Cookie
|
||||
Query map[string]any `json:"query"` // 请求query
|
||||
FullUrl string `json:"full_url"` // 完整的请求URL
|
||||
ContentType string `json:"content_type"` // 请求类型
|
||||
Method string `json:"method"` // 请求方法
|
||||
DataField string `json:"data_field"` // 数据字段
|
||||
CodeField string `json:"code_field"` // 业务状态码字段
|
||||
MessageField string `json:"message_field"` // code描述字段
|
||||
DataReceiver any `json:"-"` // 响应data部分数据解析
|
||||
SuccessCodeList []string `json:"success_code_list"` // 哪些业务状态码视为成功
|
||||
ConnectTimeout int64 `json:"connect_timeout"` // 连接超时时间: ms
|
||||
ReadTimeout int64 `json:"read_timeout"` // 读取超时时间
|
||||
RetryRule *RequestRetryRule `json:"retry_rule"` // 重试规则
|
||||
Ctx context.Context `json:"-"` // 请求上下文
|
||||
PathParam map[string]string `json:"path_param"` // 替换url中的占位符
|
||||
Body map[string]any `json:"body"` // 请求Body
|
||||
Header map[string]any `json:"header"` // 请求Header
|
||||
Cookie map[string]any `json:"cookie"` // 请求Cookie
|
||||
Query map[string]any `json:"query"` // 请求query
|
||||
Static map[string]map[string]any `json:"static"` // 静态参数: location => valName => val
|
||||
FullUrl string `json:"full_url"` // 完整的请求URL
|
||||
ContentType string `json:"content_type"` // 请求类型
|
||||
Method string `json:"method"` // 请求方法
|
||||
DataField string `json:"data_field"` // 数据字段
|
||||
CodeField string `json:"code_field"` // 业务状态码字段
|
||||
MessageField string `json:"message_field"` // code描述字段
|
||||
DataReceiver any `json:"-"` // 响应data部分数据解析
|
||||
SuccessCodeList []string `json:"success_code_list"` // 哪些业务状态码视为成功
|
||||
ConnectTimeout int64 `json:"connect_timeout"` // 连接超时时间: ms
|
||||
ReadTimeout int64 `json:"read_timeout"` // 读取超时时间
|
||||
RetryRule *RequestRetryRule `json:"retry_rule"` // 重试规则
|
||||
}
|
||||
|
||||
// RequestRetryRule 重试规则
|
||||
|
@ -17,8 +17,9 @@ import (
|
||||
//
|
||||
// Date : 12:34 2024/5/31
|
||||
type Response struct {
|
||||
Header map[string]string `json:"header"` // 响应header
|
||||
Cookie map[string]string `json:"cookie"` // 响应cookie
|
||||
Query map[string]any `json:"query"` // 请求query, 模拟自循环的请求
|
||||
Header map[string]any `json:"header"` // 响应header
|
||||
Cookie map[string]any `json:"cookie"` // 响应cookie
|
||||
Data string `json:"data"` // 响应body
|
||||
Code string `json:"code"` // 业务状态码
|
||||
Message string `json:"message"` // 业务状态码描述
|
||||
|
Reference in New Issue
Block a user