fix: sqlite数据问题时间类型问题修复等

This commit is contained in:
meilin.huang
2024-01-18 17:18:17 +08:00
parent 63f0615445
commit 7c53353c60
18 changed files with 1099 additions and 100 deletions

View File

@@ -0,0 +1,19 @@
package conv
import (
"mayfly-go/pkg/logx"
"strconv"
)
// 将字符串值转为int值, 若value为空或者转换失败则返回默认值
func Str2Int(value string, defaultValue int) int {
if value == "" {
return defaultValue
}
if intV, err := strconv.Atoi(value); err != nil {
logx.ErrorTrace("str conv int error: ", err)
return defaultValue
} else {
return intV
}
}