feat: 新增简易版ioc

This commit is contained in:
meilin.huang
2024-01-21 22:52:20 +08:00
parent f4a64b96a9
commit f27d3d200f
106 changed files with 815 additions and 707 deletions

View File

@@ -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")
}