Files
quyun/backend/app/http/provider.gen.go
2025-04-14 21:15:24 +08:00

42 lines
689 B
Go
Executable File

package http
import (
"quyun/providers/wepay"
"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(
wepay *wepay.Client,
) (*posts, error) {
obj := &posts{
wepay: wepay,
}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
pays *pays,
posts *posts,
) (contracts.HttpRoute, error) {
obj := &Routes{
pays: pays,
posts: posts,
}
if err := obj.Prepare(); err != nil {
return nil, err
}
return obj, nil
}, atom.GroupRoutes); err != nil {
return err
}
return nil
}