支持marshal类型参数解析
This commit is contained in:
		
							
								
								
									
										14
									
								
								run.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								run.go
									
									
									
									
									
								
							@ -251,17 +251,19 @@ func handleData(inputVal any, rule *define.FieldRule) (any, error) {
 | 
			
		||||
		return handleString(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeBool:
 | 
			
		||||
		return handleBool(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeMapStrFloat, consts.DataTypeMapStrBool,
 | 
			
		||||
		consts.DataTypeMapStrInt, consts.DataTypeMapStrUint:
 | 
			
		||||
	case consts.DataTypeMapStrFloat, consts.DataTypeMapStrFloatWithMarshal,
 | 
			
		||||
		consts.DataTypeMapStrBool, consts.DataTypeMapStrBoolWithMarshal,
 | 
			
		||||
		consts.DataTypeMapStrInt, consts.DataTypeMapStrIntWithMarshal,
 | 
			
		||||
		consts.DataTypeMapStrUint, consts.DataTypeMapStrUintWithMarshal:
 | 
			
		||||
		// 一律按照 map[string]float64处理
 | 
			
		||||
		return handleMapStringFloat(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeMapStrAny: // 对象结构
 | 
			
		||||
	case consts.DataTypeMapStrAny, consts.DataTypeMapStrAnyWithMarshal: // 对象结构
 | 
			
		||||
		return handleMapStringAny(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeMapStrStr: // 对象结构
 | 
			
		||||
	case consts.DataTypeMapStrStr, consts.DataTypeMapStrStrWithMarshal: // 对象结构
 | 
			
		||||
		return handleMapStringString(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeMapStrSlice: // map列表
 | 
			
		||||
	case consts.DataTypeMapStrSlice, consts.DataTypeMapStrSliceWithMarshal: // map列表
 | 
			
		||||
		return handleMapStringSlice(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeMapAnyAny: // 任意类型map
 | 
			
		||||
	case consts.DataTypeMapAnyAny, consts.DataTypeMapAnyAnyWithMarshal: // 任意类型map
 | 
			
		||||
		return handleMapAnyAny(inputVal, rule)
 | 
			
		||||
	case consts.DataTypeSliceInt, consts.DataTypeSliceIntWithChar: // int数组处理
 | 
			
		||||
		return handleSliceInt(inputVal, rule)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user