Add classification annotations

This commit is contained in:
2025-10-27 23:12:15 +08:00
parent 3990ec01c6
commit 5aacb88c22
44 changed files with 2769 additions and 2241 deletions

View File

@@ -9,15 +9,27 @@ import (
"github.com/sirupsen/logrus"
)
// ============================================================================
// 结构体定义
// ============================================================================
// SettingsService 设置服务
type SettingsService struct {
mu sync.RWMutex
cache map[string]string
}
// ============================================================================
// 全局变量
// ============================================================================
var settingsService *SettingsService
var settingsOnce sync.Once
// ============================================================================
// 公共函数
// ============================================================================
// GetSettingsService 获取设置服务单例
func GetSettingsService() *SettingsService {
settingsOnce.Do(func() {
@@ -30,6 +42,10 @@ func GetSettingsService() *SettingsService {
return settingsService
}
// ============================================================================
// 私有函数
// ============================================================================
// loadAllSettings 从数据库加载所有设置到缓存
func (s *SettingsService) loadAllSettings() {
db, err := database.GetDB()