This commit is contained in:
163
backend_v1/app/http/admin/routes.gen.go
Normal file
163
backend_v1/app/http/admin/routes.gen.go
Normal file
@@ -0,0 +1,163 @@
|
||||
// Code generated by atomctl. DO NOT EDIT.
|
||||
|
||||
// Package admin provides HTTP route definitions and registration
|
||||
// for the quyun/v2 application.
|
||||
package admin
|
||||
|
||||
import (
|
||||
"quyun/v2/app/middlewares"
|
||||
"quyun/v2/app/requests"
|
||||
|
||||
"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 admin module.
|
||||
//
|
||||
// @provider contracts.HttpRoute atom.GroupRoutes
|
||||
type Routes struct {
|
||||
log *log.Entry `inject:"false"`
|
||||
middlewares *middlewares.Middlewares
|
||||
// Controller instances
|
||||
auth *auth
|
||||
medias *medias
|
||||
orders *orders
|
||||
posts *posts
|
||||
statistics *statistics
|
||||
uploads *uploads
|
||||
users *users
|
||||
}
|
||||
|
||||
// Prepare initializes the routes provider with logging configuration.
|
||||
func (r *Routes) Prepare() error {
|
||||
r.log = log.WithField("module", "routes.admin")
|
||||
r.log.Info("Initializing routes module")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Name returns the unique identifier for this routes provider.
|
||||
func (r *Routes) Name() string {
|
||||
return "admin"
|
||||
}
|
||||
|
||||
// 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: auth
|
||||
r.log.Debugf("Registering route: Post /admin/auth -> auth.Login")
|
||||
router.Post("/admin/auth"[len(r.Path()):], DataFunc1(
|
||||
r.auth.Login,
|
||||
Body[AuthBody]("body"),
|
||||
))
|
||||
// Register routes for controller: medias
|
||||
r.log.Debugf("Registering route: Delete /admin/medias/:id -> medias.Delete")
|
||||
router.Delete("/admin/medias/:id"[len(r.Path()):], Func1(
|
||||
r.medias.Delete,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/medias -> medias.List")
|
||||
router.Get("/admin/medias"[len(r.Path()):], DataFunc2(
|
||||
r.medias.List,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[ListQuery]("query"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/medias/:id -> medias.Show")
|
||||
router.Get("/admin/medias/:id"[len(r.Path()):], Func1(
|
||||
r.medias.Show,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
// Register routes for controller: orders
|
||||
r.log.Debugf("Registering route: Get /admin/orders -> orders.List")
|
||||
router.Get("/admin/orders"[len(r.Path()):], DataFunc2(
|
||||
r.orders.List,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[OrderListQuery]("query"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/orders/:id/refund -> orders.Refund")
|
||||
router.Post("/admin/orders/:id/refund"[len(r.Path()):], Func1(
|
||||
r.orders.Refund,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
// Register routes for controller: posts
|
||||
r.log.Debugf("Registering route: Delete /admin/posts/:id -> posts.Delete")
|
||||
router.Delete("/admin/posts/:id"[len(r.Path()):], Func1(
|
||||
r.posts.Delete,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/posts -> posts.List")
|
||||
router.Get("/admin/posts"[len(r.Path()):], DataFunc2(
|
||||
r.posts.List,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[ListQuery]("query"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/posts/:id -> posts.Show")
|
||||
router.Get("/admin/posts/:id"[len(r.Path()):], DataFunc1(
|
||||
r.posts.Show,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/posts -> posts.Create")
|
||||
router.Post("/admin/posts"[len(r.Path()):], Func1(
|
||||
r.posts.Create,
|
||||
Body[PostForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/posts/:id/send-to/:userId -> posts.SendTo")
|
||||
router.Post("/admin/posts/:id/send-to/:userId"[len(r.Path()):], Func2(
|
||||
r.posts.SendTo,
|
||||
PathParam[int64]("id"),
|
||||
PathParam[int64]("userId"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Put /admin/posts/:id -> posts.Update")
|
||||
router.Put("/admin/posts/:id"[len(r.Path()):], Func2(
|
||||
r.posts.Update,
|
||||
PathParam[int64]("id"),
|
||||
Body[PostForm]("form"),
|
||||
))
|
||||
// Register routes for controller: statistics
|
||||
r.log.Debugf("Registering route: Get /admin/statistics -> statistics.statistics")
|
||||
router.Get("/admin/statistics"[len(r.Path()):], DataFunc0(
|
||||
r.statistics.statistics,
|
||||
))
|
||||
// Register routes for controller: uploads
|
||||
r.log.Debugf("Registering route: Get /admin/uploads/pre-uploaded-check/:md5.:ext -> uploads.PreUploadCheck")
|
||||
router.Get("/admin/uploads/pre-uploaded-check/:md5.:ext"[len(r.Path()):], DataFunc3(
|
||||
r.uploads.PreUploadCheck,
|
||||
PathParam[string]("md5"),
|
||||
PathParam[string]("ext"),
|
||||
QueryParam[string]("mime"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/uploads/post-uploaded-action -> uploads.PostUploadedAction")
|
||||
router.Post("/admin/uploads/post-uploaded-action"[len(r.Path()):], Func1(
|
||||
r.uploads.PostUploadedAction,
|
||||
Body[PostUploadedForm]("body"),
|
||||
))
|
||||
// Register routes for controller: users
|
||||
r.log.Debugf("Registering route: Get /admin/users -> users.List")
|
||||
router.Get("/admin/users"[len(r.Path()):], DataFunc2(
|
||||
r.users.List,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[UserListQuery]("query"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/users/:id -> users.Show")
|
||||
router.Get("/admin/users/:id"[len(r.Path()):], DataFunc1(
|
||||
r.users.Show,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /admin/users/:id/articles -> users.Articles")
|
||||
router.Get("/admin/users/:id/articles"[len(r.Path()):], DataFunc2(
|
||||
r.users.Articles,
|
||||
PathParam[int64]("id"),
|
||||
Query[requests.Pagination]("pagination"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/users/:id/balance -> users.Balance")
|
||||
router.Post("/admin/users/:id/balance"[len(r.Path()):], Func2(
|
||||
r.users.Balance,
|
||||
PathParam[int64]("id"),
|
||||
Body[UserBalance]("balance"),
|
||||
))
|
||||
|
||||
r.log.Info("Successfully registered all routes")
|
||||
}
|
||||
Reference in New Issue
Block a user