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,14 @@
package persistence
import "mayfly-go/internal/auth/domain/repository"
var (
authAccountRepo = newAuthAccountRepo()
import (
"mayfly-go/internal/auth/domain/repository"
"mayfly-go/pkg/ioc"
)
func GetOauthAccountRepo() repository.Oauth2Account {
return authAccountRepo
func Init() {
ioc.Register(newAuthAccountRepo(), ioc.WithComponentName("Oauth2AccountRepo"))
}
func GetOauthAccountRepo() repository.Oauth2Account {
return ioc.Get[repository.Oauth2Account]("Oauth2AccountRepo")
}