diff --git a/utils/typeconv.go b/utils/typeconv.go index 5d3889f2..fa85e542 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -15,8 +15,11 @@ import ( "git.rosy.net.cn/baseapi" "github.com/gazeboxu/mapstructure" "github.com/gazeboxu/structs" + jsoniter "github.com/json-iterator/go" ) +var json1 = jsoniter.ConfigCompatibleWithStandardLibrary + const MaxTimeSecond = 9573800254 // 正常最大的秒数 var ( @@ -562,6 +565,18 @@ func Str2Int(s string) (i int) { return int(Str2Int64WithDefault(s, 0)) } +//func String2Int64Slice(s string) []int64 { +// res := make([]int64, 0) +// if len(s) == 0 { +// return res +// } +// if err := json1.DecoderOf(s, &res); err != nil { +// log.Warnf("Error to deserialize string of []int64:%s, err=%v", s, err) +// return res +// } +// return res +//} + func Float64TwoInt(f float64) (i int) { return int(Float64TwoInt64(f)) }