forked from ebhomengo/niki
21 lines
1.2 KiB
Go
21 lines
1.2 KiB
Go
package adminkindboxreqhandler
|
|
|
|
import (
|
|
"git.gocasts.ir/ebhomengo/niki/delivery/http_server/middleware"
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
echo "github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func (h Handler) SetRoutes(e *echo.Echo) {
|
|
r := e.Group("/admins/kindboxreqs")
|
|
|
|
r.Use(middleware.Auth(h.authSvc))
|
|
r.POST("", h.AddKindBoxReq, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqAddPermission))
|
|
r.PATCH("/:id/accept-kind-box-req", h.Accept, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqAcceptPermission))
|
|
r.PATCH("/:id/reject-kind-box-req", h.Reject, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqRejectPermission))
|
|
r.PATCH("/:id/assign-sender-agent", h.AssignSenderAgent, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqAssignSenderAgentPermission))
|
|
r.GET("", h.GetAll, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqGetAllPermission))
|
|
r.PUT("/:id", h.Update, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqUpdatePermission))
|
|
r.GET("/:id", h.Get, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxReqGetPermission))
|
|
}
|