fix: issues

This commit is contained in:
Rogee
2024-12-10 10:24:31 +08:00
parent 0c9cb498d5
commit cb1cdee87e
32 changed files with 226 additions and 61 deletions

View File

@@ -8,14 +8,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 {
@@ -38,10 +41,12 @@ func Provide(opts ...opt.Option) error {
if err := container.Container.Provide(func(
db *sql.DB,
hashIds *hashids.HashID,
storageConfig *storage.Config,
) (*Service, error) {
obj := &Service{
db: db,
hashIds: hashIds,
storageConfig: storageConfig,
}
if err := obj.Prepare(); err != nil {