Files
quyun-v2/backend/app/http/v1/provider.gen.go
Rogee 33e1921e17 Refactor super module: Move HTTP handlers to new super/v1 package
- Deleted old super.go file and moved all related HTTP handlers to new package structure under backend/app/http/super/v1.
- Updated service imports in super.go and super_test.go to reflect new DTO paths.
- Created new auth, contents, orders, tenants, and users handlers with corresponding routes and methods.
- Added new DTO definitions for authentication and content management in the super/v1/dto directory.
- Implemented new migration for content_access table and created model for it.
2025-12-29 17:17:07 +08:00

92 lines
1.7 KiB
Go
Executable File

package v1
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() (*Auth, error) {
obj := &Auth{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*Common, error) {
obj := &Common{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*Content, error) {
obj := &Content{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*Creator, error) {
obj := &Creator{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
auth *Auth,
common *Common,
content *Content,
creator *Creator,
middlewares *middlewares.Middlewares,
tenant *Tenant,
transaction *Transaction,
user *User,
) (contracts.HttpRoute, error) {
obj := &Routes{
auth: auth,
common: common,
content: content,
creator: creator,
middlewares: middlewares,
tenant: tenant,
transaction: transaction,
user: user,
}
if err := obj.Prepare(); err != nil {
return nil, err
}
return obj, nil
}, atom.GroupRoutes); err != nil {
return err
}
if err := container.Container.Provide(func() (*Tenant, error) {
obj := &Tenant{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*Transaction, error) {
obj := &Transaction{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*User, error) {
obj := &User{}
return obj, nil
}); err != nil {
return err
}
return nil
}