2022-09-09 18:26:08 +08:00
|
|
|
package application
|
|
|
|
|
|
2023-03-06 16:59:57 +08:00
|
|
|
import (
|
2024-01-21 22:52:20 +08:00
|
|
|
"mayfly-go/pkg/ioc"
|
2023-03-06 16:59:57 +08:00
|
|
|
)
|
2022-09-09 18:26:08 +08:00
|
|
|
|
2024-01-22 11:35:28 +08:00
|
|
|
func InitIoc() {
|
2026-02-01 13:35:23 +08:00
|
|
|
ioc.Register(new(accountAppImpl))
|
|
|
|
|
ioc.Register(new(roleAppImpl))
|
|
|
|
|
ioc.Register(new(configAppImpl))
|
|
|
|
|
ioc.Register(new(resourceAppImpl))
|
|
|
|
|
ioc.Register(new(syslogAppImpl))
|
2024-01-21 22:52:20 +08:00
|
|
|
}
|
2022-09-09 18:26:08 +08:00
|
|
|
|
|
|
|
|
func GetAccountApp() Account {
|
2026-01-05 20:07:17 +08:00
|
|
|
return ioc.Get[Account]()
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetConfigApp() Config {
|
2026-01-05 20:07:17 +08:00
|
|
|
return ioc.Get[Config]()
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetSyslogApp() Syslog {
|
2026-01-05 20:07:17 +08:00
|
|
|
return ioc.Get[Syslog]()
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|