forked from ebhomengo/niki
1
0
Fork 0
niki/delivery/http_server/admin/kind_box/route.go

20 lines
929 B
Go
Raw Normal View History

package adminkindboxhandler
import (
2024-07-01 17:13:28 +00:00
"git.gocasts.ir/ebhomengo/niki/delivery/http_server/middleware"
"git.gocasts.ir/ebhomengo/niki/entity"
"github.com/labstack/echo/v4"
)
2024-07-01 17:13:28 +00:00
func (h Handler) SetRoutes(e *echo.Echo) {
r := e.Group("/admins/kindboxes")
2024-07-01 17:13:28 +00:00
r.Use(middleware.Auth(h.authSvc))
2024-07-01 17:13:28 +00:00
r.GET("/:id", h.Get, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxGetPermission))
r.PATCH("/:id/assign-receiver-agent", h.AssignReceiverAgent, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxAssignReceiverAgentPermission))
2024-07-09 17:17:04 +00:00
r.GET("", h.GetAll, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxGetAllPermission))
r.PATCH("/:id/enumerate", h.Enumerate, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxEnumeratePermission))
r.PUT("/update/:id", h.Update, middleware.AdminAuthorization(h.adminAuthorizeSvc, entity.AdminKindBoxUpdatePermission))
}