切换序列化库

This commit is contained in:
2023-08-11 13:56:40 +08:00
parent 65186fe23b
commit bff3fa8566
4 changed files with 31 additions and 22 deletions

View File

@ -10,7 +10,7 @@ package wrapper
import (
"encoding/json"
"errors"
"git.zhangdeman.cn/zhangdeman/util"
"git.zhangdeman.cn/zhangdeman/serialize"
"reflect"
)
@ -112,7 +112,7 @@ func (ot *ObjectType) ToMapStringAny() ObjectResult {
if ot.IsNil() {
return res
}
res.Err = util.JSON.UnmarshalWithNumber(ot.byteData, &res.Value)
res.Err = serialize.JSON.UnmarshalWithNumber(ot.byteData, &res.Value)
return res
}
@ -128,7 +128,7 @@ func (ot *ObjectType) ToStruct(receiver interface{}) error {
if ot.IsNil() {
return errors.New("data is nil")
}
return util.JSON.UnmarshalWithNumber(ot.byteData, receiver)
return serialize.JSON.UnmarshalWithNumber(ot.byteData, receiver)
}
// ToStructIgnoreErr ...
@ -143,5 +143,5 @@ func (ot *ObjectType) ToStructIgnoreErr(receiver interface{}) {
if ot.IsNil() {
return
}
_ = util.JSON.UnmarshalWithNumber(ot.byteData, receiver)
_ = serialize.JSON.UnmarshalWithNumber(ot.byteData, receiver)
}