extended MW
This commit is contained in:
parent
7ccf5eaa87
commit
520f0e6ec7
3 changed files with 37 additions and 18 deletions
|
|
@ -25,12 +25,7 @@ type App struct {
|
|||
|
||||
func New(ctx context.Context, cfg config.Config) *App {
|
||||
//providers
|
||||
r := router.NewRouter(router.Deps{
|
||||
Host: cfg.Http.Host,
|
||||
Port: cfg.Http.Port,
|
||||
Prefix: cfg.Http.Prefix,
|
||||
GinMode: cfg.Http.GinMode,
|
||||
})
|
||||
u := utils.New()
|
||||
|
||||
dbPool, err := dbase.ConnectPool(ctx, dbase.Deps{
|
||||
Host: cfg.DBase.Host,
|
||||
|
|
@ -40,13 +35,20 @@ func New(ctx context.Context, cfg config.Config) *App {
|
|||
DBName: cfg.DBase.DBName,
|
||||
})
|
||||
|
||||
u := utils.New()
|
||||
|
||||
//providers with deps
|
||||
userProv := user.New(user.Deps{
|
||||
DB: dbPool,
|
||||
Utils: u,
|
||||
})
|
||||
|
||||
r := router.NewRouter(router.Deps{
|
||||
Host: cfg.Http.Host,
|
||||
Port: cfg.Http.Port,
|
||||
Prefix: cfg.Http.Prefix,
|
||||
GinMode: cfg.Http.GinMode,
|
||||
UserProvider: userProv,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalf("%v failed to connect database", pkgLogHeader)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue