// Code generated by atomctl. DO NOT EDIT. // Package api provides HTTP route definitions and registration // for the quyun/v2 application. package api 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 api module. // // @provider contracts.HttpRoute atom.GroupRoutes type Routes struct { log *log.Entry `inject:"false"` // Controller instances apiController *ApiController } // Prepare initializes the routes provider with logging configuration. func (r *Routes) Prepare() error { r.log = log.WithField("module", "routes.api") r.log.Info("Initializing routes module") return nil } // Name returns the unique identifier for this routes provider. func (r *Routes) Name() string { return "api" } // 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: ApiController r.log.Debugf("Registering route: Get /v1/admin/medias -> apiController.AdminMedias") router.Get("/v1/admin/medias", Func0( r.apiController.AdminMedias, )) r.log.Debugf("Registering route: Get /v1/admin/medias/:id -> apiController.AdminMediaShow") router.Get("/v1/admin/medias/:id", Func0( r.apiController.AdminMediaShow, )) r.log.Debugf("Registering route: Get /v1/admin/orders -> apiController.AdminOrders") router.Get("/v1/admin/orders", Func0( r.apiController.AdminOrders, )) r.log.Debugf("Registering route: Get /v1/admin/statistics -> apiController.AdminStatistics") router.Get("/v1/admin/statistics", Func0( r.apiController.AdminStatistics, )) r.log.Debugf("Registering route: Get /v1/auth/login -> apiController.WeChatOAuthCallback") router.Get("/v1/auth/login", Func0( r.apiController.WeChatOAuthCallback, )) r.log.Debugf("Registering route: Get /v1/auth/wechat -> apiController.WeChatOAuthStart") router.Get("/v1/auth/wechat", Func0( r.apiController.WeChatOAuthStart, )) r.log.Debugf("Registering route: Get /v1/posts -> apiController.ListPosts") router.Get("/v1/posts", Func1( r.apiController.ListPosts, Query[PostsQuery]("query"), )) r.log.Debugf("Registering route: Get /v1/posts/:id/play -> apiController.PlayPost") router.Get("/v1/posts/:id/play", Func1( r.apiController.PlayPost, PathParam[int]("id"), )) r.log.Debugf("Registering route: Get /v1/posts/:id/show -> apiController.ShowPost") router.Get("/v1/posts/:id/show", Func1( r.apiController.ShowPost, PathParam[int]("id"), )) r.log.Debugf("Registering route: Get /v1/posts/mine -> apiController.MinePosts") router.Get("/v1/posts/mine", Func1( r.apiController.MinePosts, Query[PostsQuery]("query"), )) r.log.Debugf("Registering route: Get /v1/users/profile -> apiController.UserProfile") router.Get("/v1/users/profile", Func0( r.apiController.UserProfile, )) r.log.Debugf("Registering route: Get /v1/wechats/js-sdk -> apiController.WechatJSSDK") router.Get("/v1/wechats/js-sdk", Func0( r.apiController.WechatJSSDK, )) r.log.Debugf("Registering route: Post /v1/admin/auth -> apiController.AdminAuth") router.Post("/v1/admin/auth", Func0( r.apiController.AdminAuth, )) r.log.Debugf("Registering route: Post /v1/admin/orders/:id/refund -> apiController.AdminOrderRefund") router.Post("/v1/admin/orders/:id/refund", Func1( r.apiController.AdminOrderRefund, PathParam[int]("id"), )) r.log.Debugf("Registering route: Post /v1/posts/:id/buy -> apiController.BuyPost") router.Post("/v1/posts/:id/buy", Func1( r.apiController.BuyPost, PathParam[int]("id"), )) r.log.Debugf("Registering route: Put /v1/users/username -> apiController.UpdateUsername") router.Put("/v1/users/username", Func1( r.apiController.UpdateUsername, Body[UpdateUsernameReq]("req"), )) r.log.Info("Successfully registered all routes") }