实现七月迭代公共技术基础
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
This commit is contained in:
24
pkg/constants/system_config.go
Normal file
24
pkg/constants/system_config.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user