// Code generated by the atomctl ; DO NOT EDIT. package http 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" "quyun/app/requests" "quyun/database/schemas/public/model" ) // @provider contracts.HttpRoute atom.GroupRoutes type Routes struct { log *log.Entry `inject:"false"` auth *auth pays *pays posts *posts } func (r *Routes) Prepare() error { r.log = log.WithField("module", "routes.http") return nil } func (r *Routes) Name() string { return "http" } func (r *Routes) Register(router fiber.Router) { // 注册路由组: auth router.Get("/auth/login", Func3( r.auth.Login, QueryParam[string]("code"), QueryParam[string]("state"), QueryParam[string]("redirect"), )) router.Get("/auth/wechat", Func1( r.auth.Wechat, QueryParam[string]("redirect"), )) // 注册路由组: pays router.Get("/pay/callback/:channel", Func1( r.pays.Callback, PathParam[string]("channel"), )) // 注册路由组: posts router.Get("/api/posts", DataFunc3( r.posts.List, Query[requests.Pagination]("pagination"), Query[ListQuery]("query"), Local[*model.Users]("user"), )) router.Get("/api/posts/show/:id", DataFunc1( r.posts.Show, PathParam[int64]("id"), )) router.Get("/api/posts/mine", DataFunc2( r.posts.Mine, Query[requests.Pagination]("pagination"), Query[ListQuery]("query"), )) router.Get("/api/posts/buy/:id", DataFunc2( r.posts.Buy, PathParam[int64]("id"), Local[*model.Users]("user"), )) }