Files
quyun-v2/backend/app/http/tenant_media/routes.gen.go

54 lines
1.6 KiB
Go

// Code generated by atomctl. DO NOT EDIT.
// Package tenant_media provides HTTP route definitions and registration
// for the quyun/v2 application.
package tenant_media
import (
"quyun/v2/app/middlewares"
"quyun/v2/database/models"
"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 tenant_media module.
//
// @provider contracts.HttpRoute atom.GroupRoutes
type Routes struct {
log *log.Entry `inject:"false"`
middlewares *middlewares.Middlewares
// Controller instances
media *media
}
// Prepare initializes the routes provider with logging configuration.
func (r *Routes) Prepare() error {
r.log = log.WithField("module", "routes.tenant_media")
r.log.Info("Initializing routes module")
return nil
}
// Name returns the unique identifier for this routes provider.
func (r *Routes) Name() string {
return "tenant_media"
}
// 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: media
r.log.Debugf("Registering route: Get /t/:tenantCode/v1/media/play -> media.play")
router.Get("/t/:tenantCode/v1/media/play"[len(r.Path()):], Func2(
r.media.play,
Local[*models.Tenant]("tenant"),
QueryParam[string]("token"),
))
r.log.Info("Successfully registered all routes")
}