refactor(core): finalize context test and standalone repository fallback

This commit is contained in:
ryan
2026-08-28 13:38:22 +08:00
parent a296818922
commit 9213ee79b3
2 changed files with 3 additions and 2 deletions
-1
View File
@@ -532,4 +532,3 @@ func TestContext_ScopedExtpoints_RevertibleEffects(t *testing.T) {
assert.Equal(t, 0, len(root.Settings().Schemas()))
assert.Equal(t, 0, root.Events().Listeners("test:event"))
}
+3 -1
View File
@@ -11,6 +11,7 @@ import (
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/pkg/util"
database "Wavelet/plugins/infra/database"
"gorm.io/gorm"
)
@@ -39,7 +40,8 @@ func getDB(ctx context.Context) *gorm.DB {
return s.DB(ctx)
}
return nil
// Fallback for standalone CLI commands running without core.App
return database.DB(ctx)
}
// GetUserByID 通过 ID 获取用户