feat: update
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
_ "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
|
||||
@@ -19,7 +20,7 @@ import (
|
||||
type Routes struct {
|
||||
log *log.Entry `inject:"false"`
|
||||
// Controller instances
|
||||
superController *SuperController
|
||||
authController *authController
|
||||
}
|
||||
|
||||
// Prepare initializes the routes provider with logging configuration.
|
||||
@@ -37,33 +38,11 @@ func (r *Routes) Name() string {
|
||||
// Register registers all HTTP routes with the provided fiber router.
|
||||
// Each route is registered with its corresponding controller action and parameter bindings.
|
||||
func (r *Routes) Register(router fiber.Router) {
|
||||
// Register routes for controller: SuperController
|
||||
r.log.Debugf("Registering route: Get /super -> superController.SuperIndex")
|
||||
router.Get("/super", Func0(
|
||||
r.superController.SuperIndex,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/* -> superController.SuperWildcard")
|
||||
router.Get("/super/*", Func0(
|
||||
r.superController.SuperWildcard,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/v1/roles -> superController.Roles")
|
||||
router.Get("/super/v1/roles", Func0(
|
||||
r.superController.Roles,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/v1/statistics -> superController.Statistics")
|
||||
router.Get("/super/v1/statistics", Func0(
|
||||
r.superController.Statistics,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/v1/tenants -> superController.Tenants")
|
||||
router.Get("/super/v1/tenants", Func1(
|
||||
r.superController.Tenants,
|
||||
Query[TenantsQuery]("query"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Put /super/v1/roles/:code -> superController.UpdateRole")
|
||||
router.Put("/super/v1/roles/:code", Func2(
|
||||
r.superController.UpdateRole,
|
||||
PathParam[string]("code"),
|
||||
Body[UpdateRoleReq]("req"),
|
||||
// Register routes for controller: authController
|
||||
r.log.Debugf("Registering route: Post /super/v1/auth/login -> authController.login")
|
||||
router.Post("/super/v1/auth/login", DataFunc1(
|
||||
r.authController.login,
|
||||
Body[dto.LoginForm]("form"),
|
||||
))
|
||||
|
||||
r.log.Info("Successfully registered all routes")
|
||||
|
||||
Reference in New Issue
Block a user