feat: add static file serving and refactor route registration

This commit is contained in:
2025-12-16 22:40:31 +08:00
parent 55c40c4601
commit 2a12e1c3a9
7 changed files with 41 additions and 21 deletions

View File

@@ -26,11 +26,13 @@ func Provide(opts ...opt.Option) error {
}
if err := container.Container.Provide(func(
authController *authController,
staticController *staticController,
tenant *tenant,
) (contracts.HttpRoute, error) {
obj := &Routes{
authController: authController,
tenant: tenant,
authController: authController,
staticController: staticController,
tenant: tenant,
}
if err := obj.Prepare(); err != nil {
return nil, err
@@ -40,6 +42,13 @@ func Provide(opts ...opt.Option) error {
}, atom.GroupRoutes); err != nil {
return err
}
if err := container.Container.Provide(func() (*staticController, error) {
obj := &staticController{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*tenant, error) {
obj := &tenant{}