mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-25 02:20:30 +08:00
feat: 新增简易版ioc
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
package application
|
||||
|
||||
import "mayfly-go/internal/auth/infrastructure/persistence"
|
||||
|
||||
var (
|
||||
authApp = newAuthApp(persistence.GetOauthAccountRepo())
|
||||
import (
|
||||
"mayfly-go/internal/auth/infrastructure/persistence"
|
||||
"mayfly-go/pkg/ioc"
|
||||
)
|
||||
|
||||
func GetAuthApp() Oauth2 {
|
||||
return authApp
|
||||
func init() {
|
||||
persistence.Init()
|
||||
|
||||
ioc.Register(new(oauth2AppImpl), ioc.WithComponentName("Oauth2App"))
|
||||
}
|
||||
|
||||
func GetAuthApp() Oauth2 {
|
||||
return ioc.Get[Oauth2]("Oauth2App")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user