refactor: standardize code comments

This commit is contained in:
tinkle-community
2025-12-08 01:40:48 +08:00
parent 0636ced476
commit a12c0ae8c9
103 changed files with 5466 additions and 5468 deletions

View File

@@ -6,26 +6,26 @@ import (
"strings"
)
// 全局配置实例
// Global configuration instance
var global *Config
// Config 全局配置(从 .env 加载)
// 只包含真正的全局配置,交易相关配置在 trader/策略 级别
// Config is the global configuration (loaded from .env)
// Only contains truly global config, trading related config is at trader/strategy level
type Config struct {
// 服务配置
// Service configuration
APIServerPort int
JWTSecret string
RegistrationEnabled bool
}
// Init 初始化全局配置(从 .env 加载)
// Init initializes global configuration (from .env)
func Init() {
cfg := &Config{
APIServerPort: 8080,
RegistrationEnabled: true,
}
// 从环境变量加载
// Load from environment variables
if v := os.Getenv("JWT_SECRET"); v != "" {
cfg.JWTSecret = strings.TrimSpace(v)
}
@@ -46,7 +46,7 @@ func Init() {
global = cfg
}
// Get 获取全局配置
// Get returns the global configuration
func Get() *Config {
if global == nil {
Init()