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

@@ -3,7 +3,7 @@ package entity
import (
"encoding/json"
"mayfly-go/pkg/model"
"strconv"
"mayfly-go/pkg/utils/stringx"
)
const (
@@ -49,7 +49,7 @@ func (c *Config) IntValue(defaultValue int) int {
if c.Id == 0 {
return defaultValue
}
return c.ConvInt(c.Value, defaultValue)
return stringx.ConvInt(c.Value, defaultValue)
}
// 转换配置中的值为bool类型默认"1"或"true"为true其他为false
@@ -59,15 +59,3 @@ func (c *Config) ConvBool(value string, defaultValue bool) bool {
}
return value == "1" || value == "true"
}
// 转换配置值中的值为int
func (c *Config) ConvInt(value string, defaultValue int) int {
if value == "" {
return defaultValue
}
if intV, err := strconv.Atoi(value); err != nil {
return defaultValue
} else {
return intV
}
}