60 lines
1.7 KiB
Go
60 lines
1.7 KiB
Go
// Code generated by atomctl. DO NOT EDIT.
|
|
|
|
// Package web provides HTTP route definitions and registration
|
|
// for the quyun/v2 application.
|
|
package web
|
|
|
|
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 web module.
|
|
//
|
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
|
type Routes struct {
|
|
log *log.Entry `inject:"false"`
|
|
// Controller instances
|
|
webController *WebController
|
|
}
|
|
|
|
// Prepare initializes the routes provider with logging configuration.
|
|
func (r *Routes) Prepare() error {
|
|
r.log = log.WithField("module", "routes.web")
|
|
r.log.Info("Initializing routes module")
|
|
return nil
|
|
}
|
|
|
|
// Name returns the unique identifier for this routes provider.
|
|
func (r *Routes) Name() string {
|
|
return "web"
|
|
}
|
|
|
|
// 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: WebController
|
|
r.log.Debugf("Registering route: Get / -> webController.UserIndex")
|
|
router.Get("/", Func0(
|
|
r.webController.UserIndex,
|
|
))
|
|
r.log.Debugf("Registering route: Get /* -> webController.UserWildcard")
|
|
router.Get("/*", Func0(
|
|
r.webController.UserWildcard,
|
|
))
|
|
r.log.Debugf("Registering route: Get /admin -> webController.AdminIndex")
|
|
router.Get("/admin", Func0(
|
|
r.webController.AdminIndex,
|
|
))
|
|
r.log.Debugf("Registering route: Get /admin/* -> webController.AdminWildcard")
|
|
router.Get("/admin/*", Func0(
|
|
r.webController.AdminWildcard,
|
|
))
|
|
|
|
r.log.Info("Successfully registered all routes")
|
|
}
|