- 使用utils.Struct2MapByJson替代直接使用structs.Map
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"reflect"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"github.com/fatih/structs"
|
||||
)
|
||||
|
||||
func CheckAndGetStructValue(item interface{}) *reflect.Value {
|
||||
@@ -70,7 +69,7 @@ func FlatMap(in map[string]interface{}) map[string]interface{} {
|
||||
}
|
||||
|
||||
func Struct2FlatMap(obj interface{}) map[string]interface{} {
|
||||
m := structs.Map(obj)
|
||||
m := utils.Struct2MapByJson(obj)
|
||||
return FlatMap(m)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user