feat: add callback
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"quyun/providers/wepay"
|
||||
|
||||
"go.ipao.vip/atom"
|
||||
"go.ipao.vip/atom/container"
|
||||
"go.ipao.vip/atom/contracts"
|
||||
@@ -8,17 +10,23 @@ import (
|
||||
)
|
||||
|
||||
func Provide(opts ...opt.Option) error {
|
||||
if err := container.Container.Provide(func() (*posts, error) {
|
||||
obj := &posts{}
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user