feat: 密钥管理

This commit is contained in:
tbphp
2025-07-04 21:19:15 +08:00
parent 7c10474d19
commit 01b86f7e30
23 changed files with 1427 additions and 250 deletions

View File

@@ -276,3 +276,16 @@ func getEnvOrDefault(key, defaultValue string) string {
}
return defaultValue
}
// GetInt is a helper function for SystemSettingsManager to get an integer value with a default.
func (s *SystemSettingsManager) GetInt(key string, defaultValue int) int {
s.mu.RLock()
defer s.mu.RUnlock()
if valStr, ok := s.settingsCache[key]; ok {
if valInt, err := strconv.Atoi(valStr); err == nil {
return valInt
}
}
return defaultValue
}