remove: tenantslug
This commit is contained in:
@@ -30,26 +30,23 @@ func (r *Routes) Name() string {
|
||||
|
||||
func (r *Routes) Register(router fiber.Router) {
|
||||
// 注册路由组: Controller
|
||||
router.Get("/api/v1/posts", DataFunc4(
|
||||
router.Get("/api/v1/posts", DataFunc3(
|
||||
r.controller.List,
|
||||
CookieParam("tenant"),
|
||||
Local[*jwt.Claims]("claim"),
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[UserPostFilter]("filter"),
|
||||
))
|
||||
|
||||
router.Get("/api/v1/bought-posts", DataFunc4(
|
||||
router.Get("/api/v1/bought-posts", DataFunc3(
|
||||
r.controller.ListBought,
|
||||
CookieParam("tenant"),
|
||||
Local[*jwt.Claims]("claim"),
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[UserPostFilter]("filter"),
|
||||
))
|
||||
|
||||
router.Get("/api/v1/show/:hash", DataFunc3(
|
||||
router.Get("/api/v1/show/:hash", DataFunc2(
|
||||
r.controller.Show,
|
||||
Local[*jwt.Claims]("claim"),
|
||||
CookieParam("tenant"),
|
||||
PathParam[string]("hash"),
|
||||
))
|
||||
|
||||
@@ -60,4 +57,18 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
Body[PostBody]("body"),
|
||||
))
|
||||
|
||||
router.Delete("/api/v1/posts/:hash", Func3(
|
||||
r.controller.Delete,
|
||||
Local[*jwt.Claims]("claim"),
|
||||
CookieParam("tenant"),
|
||||
PathParam[string]("hash"),
|
||||
))
|
||||
|
||||
router.Put("/api/v1/posts/:hash", Func3(
|
||||
r.controller.Update,
|
||||
Local[*jwt.Claims]("claim"),
|
||||
PathParam[string]("hash"),
|
||||
Body[PostBody]("body"),
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user