feat: 添加 Redis 配置项
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
eafe6c2f6b
commit
962142c4a5
@ -12,9 +12,18 @@ type Config struct {
|
|||||||
Dubbo DubboConfig
|
Dubbo DubboConfig
|
||||||
JWT JWTConfig
|
JWT JWTConfig
|
||||||
OSS OSSConfig
|
OSS OSSConfig
|
||||||
|
Redis RedisConfig // 新增
|
||||||
Root string
|
Root string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RedisConfig Redis 配置
|
||||||
|
type RedisConfig struct {
|
||||||
|
Host string
|
||||||
|
Port int
|
||||||
|
Password string
|
||||||
|
DB int
|
||||||
|
}
|
||||||
|
|
||||||
// ServerConfig 服务器配置
|
// ServerConfig 服务器配置
|
||||||
type ServerConfig struct {
|
type ServerConfig struct {
|
||||||
Port string
|
Port string
|
||||||
@ -92,6 +101,12 @@ func Load() *Config {
|
|||||||
AssetDir: getEnv("OSS_ASSET_DIR", "asset/"),
|
AssetDir: getEnv("OSS_ASSET_DIR", "asset/"),
|
||||||
TokenExpireTime: getEnvInt("OSS_TOKEN_EXPIRE_TIME", 3600),
|
TokenExpireTime: getEnvInt("OSS_TOKEN_EXPIRE_TIME", 3600),
|
||||||
},
|
},
|
||||||
|
Redis: RedisConfig{
|
||||||
|
Host: getEnv("REDIS_HOST", "127.0.0.1"),
|
||||||
|
Port: getEnvInt("REDIS_PORT", 6379),
|
||||||
|
Password: getEnv("REDIS_PASSWORD", ""),
|
||||||
|
DB: getEnvInt("REDIS_DB", 0),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user