init
This commit is contained in:
57
backend/app/http/v1/routes.gen.go
Normal file
57
backend/app/http/v1/routes.gen.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Code generated by atomctl. DO NOT EDIT.
|
||||
|
||||
// Package v1 provides HTTP route definitions and registration
|
||||
// for the quyun/v2 application.
|
||||
package v1
|
||||
|
||||
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"
|
||||
"mime/multipart"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/providers/jwt"
|
||||
)
|
||||
|
||||
// Routes implements the HttpRoute contract and provides route registration
|
||||
// for all controllers in the v1 module.
|
||||
//
|
||||
// @provider contracts.HttpRoute atom.GroupRoutes
|
||||
type Routes struct {
|
||||
log *log.Entry `inject:"false"`
|
||||
// Controller instances
|
||||
demo *demo
|
||||
}
|
||||
|
||||
// Prepare initializes the routes provider with logging configuration.
|
||||
func (r *Routes) Prepare() error {
|
||||
r.log = log.WithField("module", "routes.v1")
|
||||
r.log.Info("Initializing routes module")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Name returns the unique identifier for this routes provider.
|
||||
func (r *Routes) Name() string {
|
||||
return "v1"
|
||||
}
|
||||
|
||||
// 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: demo
|
||||
r.log.Debugf("Registering route: Post /v1/medias/:id -> demo.Foo")
|
||||
router.Post("/v1/medias/:id", Func7(
|
||||
r.demo.Foo,
|
||||
PathParam[int]("id"),
|
||||
Query[requests.Pagination]("pager"),
|
||||
Query[FooQuery]("query"),
|
||||
Header[FooHeader]("header"),
|
||||
Local[*jwt.Claims]("claim"),
|
||||
File[multipart.FileHeader]("file"),
|
||||
Body[FooUploadReq]("req"),
|
||||
))
|
||||
|
||||
r.log.Info("Successfully registered all routes")
|
||||
}
|
||||
Reference in New Issue
Block a user