mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
feat: 新增简易版ioc
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user