This commit is contained in:
richboo111
2022-11-22 16:04:12 +08:00
parent dc5c04fa4a
commit 48ecb044ac
4 changed files with 23 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"math"
"net/url"
"reflect"
@@ -43,6 +44,7 @@ func TryUnmarshalUseNumber(data []byte, result interface{}) error {
// 这个函数将解析json返回的map中的字段类型与structObj中的完全一样的
func Unmarshal2Map(data []byte, structObj interface{}) (resultMap map[string]interface{}, err error) {
globals.SugarLogger.Debugf("进入Unmarshal2Map")
if err = json.Unmarshal(data, structObj); err == nil {
if err = json.Unmarshal(data, &resultMap); err == nil {
m := Struct2MapByJson(structObj)
@@ -55,6 +57,7 @@ func Unmarshal2Map(data []byte, structObj interface{}) (resultMap map[string]int
}
}
}
globals.SugarLogger.Debugf("resultMap===========%v err=======%v", resultMap, err)
return resultMap, err
}