feat: 新增财务应用的核心数据模型定义,包含账户、交易类型、货币等枚举。
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"accounting-app/internal/config"
|
||||
@@ -20,13 +21,30 @@ func main() {
|
||||
filepath.Join("..", "..", ".env"), // Explicit path
|
||||
}
|
||||
|
||||
var envDir string
|
||||
for _, envPath := range envPaths {
|
||||
if err := godotenv.Load(envPath); err == nil {
|
||||
log.Printf("Loaded environment from: %s", envPath)
|
||||
log.Printf("Loaded base environment from: %s", envPath)
|
||||
envDir = filepath.Dir(envPath)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Load specific environment file if APP_ENV is set (e.g. .env.dev, .env.prod)
|
||||
if appEnv := os.Getenv("APP_ENV"); appEnv != "" {
|
||||
targetEnvFile := ".env." + appEnv
|
||||
targetEnvPath := targetEnvFile
|
||||
if envDir != "" && envDir != "." {
|
||||
targetEnvPath = filepath.Join(envDir, targetEnvFile)
|
||||
}
|
||||
|
||||
if err := godotenv.Overload(targetEnvPath); err == nil {
|
||||
log.Printf("Loaded specific environment config from: %s", targetEnvPath)
|
||||
} else {
|
||||
log.Printf("Note: Specific environment file %s not found or could not be loaded", targetEnvPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Load configuration
|
||||
cfg := config.Load()
|
||||
|
||||
|
||||
@@ -866,6 +866,7 @@ func AllModels() []interface{} {
|
||||
&TransactionImage{}, // Feature: accounting-feature-upgrade
|
||||
&UserSettings{}, // Feature: accounting-feature-upgrade
|
||||
&Notification{}, // Feature: notification-center
|
||||
&SystemAnnouncement{}, // Feature: system-announcement
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user