// Code generated by the atomctl ; DO NOT EDIT. package http import ( "quyun/app/model" "quyun/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" ) // @provider contracts.HttpRoute atom.GroupRoutes type Routes struct { log *log.Entry `inject:"false"` auth *auth pays *pays posts *posts users *users wechats *wechats } 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.Post("/pay/callback/:channel", Func1( r.pays.Callback, PathParam[string]("channel"), )) // 注册路由组: posts router.Get("/posts", DataFunc3( r.posts.List, Query[requests.Pagination]("pagination"), Query[ListQuery]("query"), Local[*model.Users]("user"), )) router.Get("/posts/:id/show", DataFunc2( r.posts.Show, PathParam[int64]("id"), Local[*model.Users]("user"), )) router.Get("/posts/:id/play", DataFunc2( r.posts.Play, PathParam[int64]("id"), Local[*model.Users]("user"), )) router.Get("/posts/mine", DataFunc3( r.posts.Mine, Query[requests.Pagination]("pagination"), Query[ListQuery]("query"), Local[*model.Users]("user"), )) router.Post("/posts/:id/buy", DataFunc2( r.posts.Buy, PathParam[int64]("id"), Local[*model.Users]("user"), )) // 注册路由组: users router.Get("/users/profile", DataFunc1( r.users.Profile, Local[*model.Users]("user"), )) router.Put("/users/username", Func2( r.users.Update, Local[*model.Users]("user"), Body[ProfileForm]("form"), )) // 注册路由组: wechats router.Get("/wechats/js-sdk", DataFunc2( r.wechats.GetJsSDK, QueryParam[string]("url"), Local[*model.Users]("user"), )) }