feat: add posts
This commit is contained in:
40
backend/app/http/posts/routes.gen.go
Normal file
40
backend/app/http/posts/routes.gen.go
Normal file
@@ -0,0 +1,40 @@
|
||||
// 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", DataFunc3(
|
||||
r.controller.List,
|
||||
Local[*jwt.Claims]("claim"),
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[UserPostFilter]("filter"),
|
||||
))
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user