feat: add user_list

This commit is contained in:
2025-12-17 13:24:32 +08:00
parent dae9a0e55a
commit 14842d989c
20 changed files with 736 additions and 130 deletions

View File

@@ -5,13 +5,12 @@
package super
import (
"quyun/v2/app/http/super/dto"
"github.com/gofiber/fiber/v3"
log "github.com/sirupsen/logrus"
_ "go.ipao.vip/atom"
_ "go.ipao.vip/atom/contracts"
. "go.ipao.vip/atom/fen"
"quyun/v2/app/http/super/dto"
)
// Routes implements the HttpRoute contract and provides route registration
@@ -21,9 +20,9 @@ import (
type Routes struct {
log *log.Entry `inject:"false"`
// Controller instances
authController *authController
staticController *staticController
tenant *tenant
authController *authController
tenant *tenant
user *user
}
// Prepare initializes the routes provider with logging configuration.
@@ -59,8 +58,18 @@ func (r *Routes) Register(router fiber.Router) {
PathParam[int64]("tenantID"),
Body[dto.TenantExpireUpdateForm]("form"),
))
router.Get("/super/*", Func(r.staticController.static))
r.log.Debugf("Registering route: Patch /super/v1/tenants/:tenantID/status -> tenant.updateStatus")
router.Patch("/super/v1/tenants/:tenantID/status", Func2(
r.tenant.updateStatus,
PathParam[int64]("tenantID"),
Body[dto.TenantStatusUpdateForm]("form"),
))
// Register routes for controller: user
r.log.Debugf("Registering route: Get /super/v1/users -> user.list")
router.Get("/super/v1/users", DataFunc1(
r.user.list,
Query[dto.UserPageFilter]("filter"),
))
r.log.Info("Successfully registered all routes")
}