source path 适配common
This commit is contained in:
@ -103,3 +103,7 @@ const (
|
||||
FailBehaviorContinue = "continue" // 失败后继续请求
|
||||
FailBehaviorError = "error" // 失败后终止请求
|
||||
)
|
||||
|
||||
const (
|
||||
CommonServiceAlias = "__COMMON__"
|
||||
)
|
||||
|
@ -161,13 +161,15 @@ func (c *client) buildRequestParams(apiCfg *RequestConfigGroupItem) (map[string]
|
||||
validateRuleList := make([]validate.StructField, 0)
|
||||
for _, itemParam := range apiCfg.ParamRuleList {
|
||||
arr := strings.Split(itemParam.Path, ".")
|
||||
sourcePath := itemParam.SourceResultPath
|
||||
sourcePath = fmt.Sprintf("%v.%v.%v", itemParam.SourceAlias, itemParam.SourceResultLocation, itemParam.SourceResultPath)
|
||||
validateRuleList = append(validateRuleList, validate.StructField{
|
||||
JsonTag: arr[len(arr)-1],
|
||||
Type: itemParam.Type,
|
||||
Required: false,
|
||||
RuleList: nil,
|
||||
DefaultValue: itemParam.DefaultValue,
|
||||
SourcePath: fmt.Sprintf("%v.%v.%v", itemParam.SourceAlias, itemParam.SourceResultLocation, itemParam.SourceResultPath), // TODO : 公共参数特殊处理
|
||||
SourcePath: sourcePath,
|
||||
TargetPath: fmt.Sprintf("%v.%v", itemParam.Location, itemParam.Path),
|
||||
Errmsg: "",
|
||||
})
|
||||
|
Reference in New Issue
Block a user