mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 09:46:37 +08:00
refactor(core): finalize context test and standalone repository fallback
This commit is contained in:
@@ -532,4 +532,3 @@ func TestContext_ScopedExtpoints_RevertibleEffects(t *testing.T) {
|
|||||||
assert.Equal(t, 0, len(root.Settings().Schemas()))
|
assert.Equal(t, 0, len(root.Settings().Schemas()))
|
||||||
assert.Equal(t, 0, root.Events().Listeners("test:event"))
|
assert.Equal(t, 0, root.Events().Listeners("test:event"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
"Wavelet/core"
|
"Wavelet/core"
|
||||||
"Wavelet/core/contracts"
|
"Wavelet/core/contracts"
|
||||||
"Wavelet/pkg/util"
|
"Wavelet/pkg/util"
|
||||||
|
database "Wavelet/plugins/infra/database"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,7 +40,8 @@ func getDB(ctx context.Context) *gorm.DB {
|
|||||||
return s.DB(ctx)
|
return s.DB(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
// Fallback for standalone CLI commands running without core.App
|
||||||
|
return database.DB(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserByID 通过 ID 获取用户
|
// GetUserByID 通过 ID 获取用户
|
||||||
|
|||||||
Reference in New Issue
Block a user