feat: complete charge
This commit is contained in:
@@ -7,14 +7,17 @@ import (
|
||||
"git.ipao.vip/rogeecn/atom/container"
|
||||
"git.ipao.vip/rogeecn/atom/contracts"
|
||||
"git.ipao.vip/rogeecn/atom/utils/opt"
|
||||
hashids "github.com/speps/go-hashids/v2"
|
||||
)
|
||||
|
||||
func Provide(opts ...opt.Option) error {
|
||||
if err := container.Container.Provide(func(
|
||||
hashIds *hashids.HashID,
|
||||
svc *Service,
|
||||
) (*Controller, error) {
|
||||
obj := &Controller{
|
||||
svc: svc,
|
||||
hashIds: hashIds,
|
||||
svc: svc,
|
||||
}
|
||||
return obj, nil
|
||||
}); err != nil {
|
||||
@@ -37,9 +40,11 @@ func Provide(opts ...opt.Option) error {
|
||||
|
||||
if err := container.Container.Provide(func(
|
||||
db *sql.DB,
|
||||
hashIds *hashids.HashID,
|
||||
) (*Service, error) {
|
||||
obj := &Service{
|
||||
db: db,
|
||||
db: db,
|
||||
hashIds: hashIds,
|
||||
}
|
||||
if err := obj.Prepare(); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user