完善validator枚举值验证
This commit is contained in:
		
							
								
								
									
										61
									
								
								data_type.go
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								data_type.go
									
									
									
									
									
								
							@ -197,12 +197,61 @@ func getDataTypeDesc(value DataType, description string) DataTypeDesc {
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// DataTypeBaseNumber 基础的int类型
 | 
			
		||||
	DataTypeBaseNumber = []DataType{DataTypeInt, DataTypeUint, DataTypeFloat, DataTypeIntPtr, DataTypeUintPtr, DataTypeFloatPtr}
 | 
			
		||||
	DataTypeBaseInt    = []DataType{DataTypeInt, DataTypeIntPtr}
 | 
			
		||||
	DataTypeBaseUint   = []DataType{DataTypeUint, DataTypeUintPtr}
 | 
			
		||||
	DataTypeBaseFloat  = []DataType{DataTypeFloat, DataTypeFloatPtr}
 | 
			
		||||
	DataTypeBaseString = []DataType{DataTypeString, DataTypeStringPtr}
 | 
			
		||||
	DataTypeBaseBool   = []DataType{DataTypeBool, DataTypeBoolPtr}
 | 
			
		||||
	DataTypeBaseNumber   = []DataType{DataTypeInt, DataTypeUint, DataTypeFloat, DataTypeIntPtr, DataTypeUintPtr, DataTypeFloatPtr}
 | 
			
		||||
	DataTypeBaseInt      = []DataType{DataTypeInt, DataTypeIntPtr}
 | 
			
		||||
	DataTypeBaseUint     = []DataType{DataTypeUint, DataTypeUintPtr}
 | 
			
		||||
	DataTypeBaseFloat    = []DataType{DataTypeFloat, DataTypeFloatPtr}
 | 
			
		||||
	DataTypeBaseString   = []DataType{DataTypeString, DataTypeStringPtr}
 | 
			
		||||
	DataTypeBaseBool     = []DataType{DataTypeBool, DataTypeBoolPtr}
 | 
			
		||||
	DataTypeSliceMarshal = []DataType{
 | 
			
		||||
		DataTypeSliceAnyWithMarshal,
 | 
			
		||||
		DataTypeSliceIntWithMarshal,
 | 
			
		||||
		DataTypeSliceUintWithMarshal,
 | 
			
		||||
		DataTypeSliceFloatWithMarshal,
 | 
			
		||||
		DataTypeSliceBoolWithMarshal,
 | 
			
		||||
		DataTypeSliceMapAnyAnyWithMarshal,
 | 
			
		||||
		DataTypeSliceMapStringAnyWithMarshal,
 | 
			
		||||
		DataTypeSliceAnyWithMarshal,
 | 
			
		||||
		DataTypeSliceSliceWithMarshal,
 | 
			
		||||
	}
 | 
			
		||||
	DataTypeSliceSplit = []DataType{
 | 
			
		||||
		DataTypeSliceIntWithChar,
 | 
			
		||||
		DataTypeSliceUintWithChar,
 | 
			
		||||
		DataTypeSliceFloatWithChar,
 | 
			
		||||
		DataTypeSliceBoolWithChar,
 | 
			
		||||
		DataTypeSliceStringWithChar,
 | 
			
		||||
	}
 | 
			
		||||
	DataTypeSlice = []DataType{
 | 
			
		||||
		DataTypeSliceString,
 | 
			
		||||
		DataTypeSliceAny,
 | 
			
		||||
		DataTypeSliceBool,
 | 
			
		||||
		DataTypeSliceMapStringAny,
 | 
			
		||||
		DataTypeSliceInt,
 | 
			
		||||
		DataTypeSliceUint,
 | 
			
		||||
		DataTypeSliceFloat,
 | 
			
		||||
		DataTypeSliceMapAnyAny,
 | 
			
		||||
		DataTypeSliceSlice,
 | 
			
		||||
	}
 | 
			
		||||
	DataTypeMap = []DataType{
 | 
			
		||||
		DataTypeMapStrAny,
 | 
			
		||||
		DataTypeMapAnyAny,
 | 
			
		||||
		DataTypeMapStrBool,
 | 
			
		||||
		DataTypeMapStrInt,
 | 
			
		||||
		DataTypeMapStrFloat,
 | 
			
		||||
		DataTypeMapStrUint,
 | 
			
		||||
		DataTypeMapStrSlice,
 | 
			
		||||
		DataTypeMapStrStr,
 | 
			
		||||
	}
 | 
			
		||||
	DataTypeMapMarshal = []DataType{
 | 
			
		||||
		DataTypeMapStrAnyWithMarshal,
 | 
			
		||||
		DataTypeMapAnyAnyWithMarshal,
 | 
			
		||||
		DataTypeMapStrBoolWithMarshal,
 | 
			
		||||
		DataTypeMapStrIntWithMarshal,
 | 
			
		||||
		DataTypeMapStrFloatWithMarshal,
 | 
			
		||||
		DataTypeMapStrUintWithMarshal,
 | 
			
		||||
		DataTypeMapStrSliceWithMarshal,
 | 
			
		||||
		DataTypeMapStrStrWithMarshal,
 | 
			
		||||
	}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func getMergeDataTypeList(dataTypeList ...[]DataType) []DataType {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user