mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 06:56:36 +08:00
refactor(core): align with cordis spatiotemporal composability architecture
- Purify core micro-kernel by removing context hardcoded helpers and reverse dependencies - Eliminate init() side effects in infra plugins with reversible lifecycle disposal - Completely isolate plugins by removing cross-plugin imports and using core/contracts - Introduce TaskService and RiskControlService contracts for unified cross-plugin APIs - Regenerate Swagger documentation and update developer guide matrix - Achieve 0 violations in check_cordis_architecture.sh and 100% test pass
This commit is contained in:
+2
-1
@@ -7,8 +7,9 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"Wavelet/core"
|
||||
)
|
||||
|
||||
var allCmd = &cobra.Command{
|
||||
|
||||
+2
-1
@@ -6,8 +6,9 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"Wavelet/core"
|
||||
)
|
||||
|
||||
var apiCmd = &cobra.Command{
|
||||
|
||||
+3
-2
@@ -10,6 +10,9 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/pressly/goose/v3"
|
||||
goosedb "github.com/pressly/goose/v3/database"
|
||||
|
||||
"Wavelet/core"
|
||||
"Wavelet/core/contracts"
|
||||
"Wavelet/pkg/config"
|
||||
@@ -28,8 +31,6 @@ import (
|
||||
infradb "Wavelet/plugins/infra/database"
|
||||
"Wavelet/plugins/infra/logger"
|
||||
"Wavelet/plugins/infra/storage"
|
||||
"github.com/pressly/goose/v3"
|
||||
goosedb "github.com/pressly/goose/v3/database"
|
||||
)
|
||||
|
||||
// newWaveletApp creates a core.App wired with Wavelet platform infrastructure, domain plugins, and profile drivers.
|
||||
|
||||
@@ -16,9 +16,10 @@ import (
|
||||
userdomain "Wavelet/plugins/domain/user"
|
||||
"Wavelet/plugins/infra/database"
|
||||
|
||||
"Wavelet/plugins/domain/auth"
|
||||
"github.com/spf13/cobra"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"Wavelet/plugins/domain/auth"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -49,7 +50,10 @@ var resetPasswdCmd = &cobra.Command{
|
||||
ctx := context.Background()
|
||||
|
||||
// Ensure database is initialized
|
||||
database.DB(ctx)
|
||||
dbConn := database.DB(ctx)
|
||||
if dbConn != nil {
|
||||
userdomain.SetDBService(database.NewService(dbConn))
|
||||
}
|
||||
|
||||
var username string
|
||||
if usernameFlag != "" {
|
||||
|
||||
+2
-1
@@ -8,11 +8,12 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"Wavelet/pkg/buildinfo"
|
||||
"Wavelet/pkg/config"
|
||||
"Wavelet/pkg/logger"
|
||||
"Wavelet/pkg/trace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const traceShutdownTimeout = 10 * time.Second
|
||||
|
||||
@@ -6,8 +6,9 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"Wavelet/core"
|
||||
)
|
||||
|
||||
var schedulerCmd = &cobra.Command{
|
||||
|
||||
@@ -6,8 +6,9 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"Wavelet/core"
|
||||
)
|
||||
|
||||
var workerCmd = &cobra.Command{
|
||||
|
||||
Reference in New Issue
Block a user