All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
25 lines
660 B
Go
25 lines
660 B
Go
package constants
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
// SystemConfigTypeString 表示字符串配置。
|
|
SystemConfigTypeString = "string"
|
|
// SystemConfigTypeInt 表示整数配置。
|
|
SystemConfigTypeInt = "int"
|
|
// SystemConfigTypeBool 表示布尔配置。
|
|
SystemConfigTypeBool = "bool"
|
|
// SystemConfigTypeJSON 表示 JSON 配置。
|
|
SystemConfigTypeJSON = "json"
|
|
// SystemConfigCacheTTL 是系统配置默认缓存时长。
|
|
SystemConfigCacheTTL = 5 * time.Minute
|
|
)
|
|
|
|
// RedisSystemConfigKey 生成单个系统配置的 Redis 缓存键。
|
|
func RedisSystemConfigKey(configKey string) string {
|
|
return fmt.Sprintf("system_config:value:%s", configKey)
|
|
}
|