Files
quyun-v2/backend/app/http/tenant/provider.gen.go
2025-12-18 09:54:29 +08:00

56 lines
1.1 KiB
Go
Executable File

package tenant
import (
"quyun/v2/app/middlewares"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"go.ipao.vip/atom/opt"
)
func Provide(opts ...opt.Option) error {
if err := container.Container.Provide(func() (*content, error) {
obj := &content{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*contentAdmin, error) {
obj := &contentAdmin{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*me, error) {
obj := &me{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
content *content,
contentAdmin *contentAdmin,
me *me,
middlewares *middlewares.Middlewares,
) (contracts.HttpRoute, error) {
obj := &Routes{
content: content,
contentAdmin: contentAdmin,
me: me,
middlewares: middlewares,
}
if err := obj.Prepare(); err != nil {
return nil, err
}
return obj, nil
}, atom.GroupRoutes); err != nil {
return err
}
return nil
}