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.
This commit is contained in:
2025-12-29 17:17:07 +08:00
parent bdf20fb0c6
commit 33e1921e17
18 changed files with 665 additions and 443 deletions

View File

@@ -0,0 +1,73 @@
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() (*contents, error) {
obj := &contents{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*orders, error) {
obj := &orders{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
auth *auth,
contents *contents,
middlewares *middlewares.Middlewares,
orders *orders,
tenants *tenants,
users *users,
) (contracts.HttpRoute, error) {
obj := &Routes{
auth: auth,
contents: contents,
middlewares: middlewares,
orders: orders,
tenants: tenants,
users: users,
}
if err := obj.Prepare(); err != nil {
return nil, err
}
return obj, nil
}, atom.GroupRoutes); err != nil {
return err
}
if err := container.Container.Provide(func() (*tenants, error) {
obj := &tenants{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*users, error) {
obj := &users{}
return obj, nil
}); err != nil {
return err
}
return nil
}