时间校验修改
This commit is contained in:
@@ -53,7 +53,7 @@ func DeSerializeData(strValue string, dataPtr interface{}) (err error) {
|
||||
}
|
||||
|
||||
// todo 这里看是否需要将key值转换成标准格式(即字母大写),因为beego orm不区分,不转换也可以
|
||||
func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, excludedFields []string, isCheckValue bool) (valid map[string]interface{}, invalid map[string]interface{}) {
|
||||
func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, objPtr interface{}, excludedFields []string, isCheckValue bool) (valid map[string]interface{}, invalid map[string]interface{}) {
|
||||
excludedMap := make(map[string]int)
|
||||
for _, v := range excludedFields {
|
||||
excludedMap[v] = 1
|
||||
@@ -69,7 +69,9 @@ func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, ex
|
||||
invalid[k] = v
|
||||
}
|
||||
}
|
||||
utils.Map2StructByJson(m, obj, true)
|
||||
if objPtr != nil {
|
||||
utils.Map2StructByJson(m, objPtr, true)
|
||||
}
|
||||
return valid, invalid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user