mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: ioc与系统初始化处理方式调整
This commit is contained in:
		@@ -5,7 +5,7 @@ import (
 | 
			
		||||
	"mayfly-go/pkg/ioc"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
func InitIoc() {
 | 
			
		||||
	persistence.Init()
 | 
			
		||||
 | 
			
		||||
	ioc.Register(new(machineAppImpl), ioc.WithComponentName("MachineApp"))
 | 
			
		||||
 
 | 
			
		||||
@@ -2,13 +2,21 @@ package init
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"mayfly-go/initialize"
 | 
			
		||||
	"mayfly-go/internal/common/consts"
 | 
			
		||||
	"mayfly-go/internal/machine/application"
 | 
			
		||||
	"mayfly-go/internal/machine/domain/entity"
 | 
			
		||||
	"mayfly-go/internal/machine/router"
 | 
			
		||||
	"mayfly-go/pkg/eventbus"
 | 
			
		||||
	"mayfly-go/pkg/global"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	initialize.AddInitIocFunc(application.InitIoc)
 | 
			
		||||
	initialize.AddInitRouterFunc(router.Init)
 | 
			
		||||
	initialize.AddInitFunc(Init)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func Init() {
 | 
			
		||||
	application.GetMachineCronJobApp().InitCronJob()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user