feat: portal tenant apply flow

This commit is contained in:
2025-12-25 11:12:11 +08:00
parent 81240fa0d1
commit 03117b827b
15 changed files with 691 additions and 12 deletions

View File

@@ -23,8 +23,9 @@ type Routes struct {
log *log.Entry `inject:"false"`
middlewares *middlewares.Middlewares
// Controller instances
auth *auth
me *me
auth *auth
me *me
tenantApply *tenantApply
}
// Prepare initializes the routes provider with logging configuration.
@@ -81,6 +82,16 @@ func (r *Routes) Register(router fiber.Router) {
router.Get("/v1/me/tenants"[len(r.Path()):], DataFunc0(
r.me.myTenants,
))
// Register routes for controller: tenantApply
r.log.Debugf("Registering route: Get /v1/tenant/application -> tenantApply.application")
router.Get("/v1/tenant/application"[len(r.Path()):], DataFunc0(
r.tenantApply.application,
))
r.log.Debugf("Registering route: Post /v1/tenant/apply -> tenantApply.apply")
router.Post("/v1/tenant/apply"[len(r.Path()):], DataFunc1(
r.tenantApply.apply,
Body[dto.TenantApplyForm]("form"),
))
r.log.Info("Successfully registered all routes")
}