feat: 添加租户创建功能,支持设置管理员及有效期,新增订单统计接口

This commit is contained in:
2025-12-23 23:03:49 +08:00
parent d09a9374ee
commit bcb8c822f1
15 changed files with 377 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ type Routes struct {
middlewares *middlewares.Middlewares
// Controller instances
auth *auth
order *order
tenant *tenant
user *user
}
@@ -53,12 +54,22 @@ func (r *Routes) Register(router fiber.Router) {
r.auth.login,
Body[dto.LoginForm]("form"),
))
// Register routes for controller: order
r.log.Debugf("Registering route: Get /super/v1/orders/statistics -> order.statistics")
router.Get("/super/v1/orders/statistics"[len(r.Path()):], DataFunc0(
r.order.statistics,
))
// Register routes for controller: tenant
r.log.Debugf("Registering route: Get /super/v1/tenants -> tenant.list")
router.Get("/super/v1/tenants"[len(r.Path()):], DataFunc1(
r.tenant.list,
Query[dto.TenantFilter]("filter"),
))
r.log.Debugf("Registering route: Post /super/v1/tenants -> tenant.create")
router.Post("/super/v1/tenants"[len(r.Path()):], DataFunc1(
r.tenant.create,
Body[dto.TenantCreateForm]("form"),
))
r.log.Debugf("Registering route: Get /super/v1/tenants/statuses -> tenant.statusList")
router.Get("/super/v1/tenants/statuses"[len(r.Path()):], DataFunc0(
r.tenant.statusList,