71 lines
2.2 KiB
Go
71 lines
2.2 KiB
Go
// Code generated by atomctl. DO NOT EDIT.
|
|
|
|
// Package super provides HTTP route definitions and registration
|
|
// for the quyun/v2 application.
|
|
package super
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v3"
|
|
log "github.com/sirupsen/logrus"
|
|
_ "go.ipao.vip/atom"
|
|
_ "go.ipao.vip/atom/contracts"
|
|
. "go.ipao.vip/atom/fen"
|
|
)
|
|
|
|
// Routes implements the HttpRoute contract and provides route registration
|
|
// for all controllers in the super module.
|
|
//
|
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
|
type Routes struct {
|
|
log *log.Entry `inject:"false"`
|
|
// Controller instances
|
|
superController *SuperController
|
|
}
|
|
|
|
// Prepare initializes the routes provider with logging configuration.
|
|
func (r *Routes) Prepare() error {
|
|
r.log = log.WithField("module", "routes.super")
|
|
r.log.Info("Initializing routes module")
|
|
return nil
|
|
}
|
|
|
|
// Name returns the unique identifier for this routes provider.
|
|
func (r *Routes) Name() string {
|
|
return "super"
|
|
}
|
|
|
|
// 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"),
|
|
))
|
|
|
|
r.log.Info("Successfully registered all routes")
|
|
}
|