2024-01-02 14:04:16 +00:00
|
|
|
package benefactorkindboxhandler
|
|
|
|
|
|
|
|
import (
|
2024-06-25 21:58:11 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/delivery/http_server/middleware"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
"github.com/labstack/echo/v4"
|
2024-01-02 14:04:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (h Handler) SetRoutes(e *echo.Echo) {
|
|
|
|
r := e.Group("/benefactor/kindboxes")
|
|
|
|
|
2024-06-25 21:58:11 +00:00
|
|
|
r.Use(
|
2024-08-01 10:20:18 +00:00
|
|
|
middleware.Auth(h.authSvc),
|
2024-06-25 21:58:11 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole),
|
|
|
|
)
|
|
|
|
|
|
|
|
r.GET("/:id", h.Get)
|
|
|
|
r.GET("", h.GetAll)
|
|
|
|
r.PATCH("/:id/emptying-requests", h.RegisterEmptyingRequest)
|
2024-01-02 14:04:16 +00:00
|
|
|
}
|