Files
qvyun/backend/app/http/posts/routes.gen.go
2025-01-14 14:42:08 +08:00

57 lines
1.2 KiB
Go

// Code generated by the atomctl ; DO NOT EDIT.
package posts
import (
"backend/app/requests"
. "backend/pkg/f"
"backend/providers/jwt"
_ "git.ipao.vip/rogeecn/atom"
_ "git.ipao.vip/rogeecn/atom/contracts"
"github.com/gofiber/fiber/v3"
log "github.com/sirupsen/logrus"
)
// @provider contracts.HttpRoute atom.GroupRoutes
type Routes struct {
log *log.Entry `inject:"false"`
controller *Controller
}
func (r *Routes) Prepare() error {
r.log = log.WithField("module", "routes.posts")
return nil
}
func (r *Routes) Name() string {
return "posts"
}
func (r *Routes) Register(router fiber.Router) {
// 注册路由组: Controller
router.Get("/api/v1/posts", DataFunc4(
r.controller.List,
CookieParam("tenant"),
Local[*jwt.Claims]("claim"),
Query[requests.Pagination]("pagination"),
Query[UserPostFilter]("filter"),
))
router.Get("/api/v1/bought-posts", DataFunc4(
r.controller.ListBought,
CookieParam("tenant"),
Local[*jwt.Claims]("claim"),
Query[requests.Pagination]("pagination"),
Query[UserPostFilter]("filter"),
))
router.Get("/api/v1/show/:hash", DataFunc3(
r.controller.Show,
Local[*jwt.Claims]("claim"),
CookieParam("tenant"),
PathParam[string]("hash"),
))
}