2022-09-09 18:26:08 +08:00
|
|
|
package application
|
|
|
|
|
|
2023-12-05 23:03:51 +08:00
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/mongo/infrastructure/persistence"
|
2024-01-21 22:52:20 +08:00
|
|
|
"mayfly-go/pkg/ioc"
|
2023-12-05 23:03:51 +08:00
|
|
|
)
|
2022-09-09 18:26:08 +08:00
|
|
|
|
2024-01-22 11:35:28 +08:00
|
|
|
func InitIoc() {
|
2024-01-21 22:52:20 +08:00
|
|
|
persistence.Init()
|
|
|
|
|
|
|
|
|
|
ioc.Register(new(mongoAppImpl), ioc.WithComponentName("MongoApp"))
|
|
|
|
|
}
|
2022-09-09 18:26:08 +08:00
|
|
|
|
|
|
|
|
func GetMongoApp() Mongo {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[Mongo]("MongoApp")
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|