feat: 机器定时删除终端操作记录

This commit is contained in:
meilin.huang
2024-01-15 20:51:41 +08:00
parent c0232c4c75
commit 493925064c
15 changed files with 98 additions and 35 deletions

View File

@@ -0,0 +1,17 @@
package stringx
import (
"strconv"
)
// 将字符串值转为int值, 若value为空或者转换失败则返回默认值
func ConvInt(value string, defaultValue int) int {
if value == "" {
return defaultValue
}
if intV, err := strconv.Atoi(value); err != nil {
return defaultValue
} else {
return intV
}
}