2024-01-22 14:41:55 +00:00
|
|
|
package benefactoraddresshandler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/delivery/http_server/middleware"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (h Handler) SetRoutes(e *echo.Echo) {
|
|
|
|
r := e.Group("/address")
|
|
|
|
|
|
|
|
r.GET("/provinces", h.GetAllProvinces)
|
|
|
|
r.GET("/cities", h.GetAllCities)
|
2024-08-01 10:20:18 +00:00
|
|
|
r.POST("/", h.AddAddress, middleware.Auth(h.authSvc),
|
2024-01-22 14:41:55 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole))
|
2024-08-01 10:20:18 +00:00
|
|
|
r.GET("/:id", h.GetAddress, middleware.Auth(h.authSvc),
|
2024-06-01 00:29:11 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole))
|
2024-08-01 10:20:18 +00:00
|
|
|
r.GET("/", h.GetAddresses, middleware.Auth(h.authSvc),
|
2024-06-01 18:01:00 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole))
|
2024-08-01 10:20:18 +00:00
|
|
|
r.DELETE("/:id", h.DeleteAddress, middleware.Auth(h.authSvc),
|
2024-06-08 14:25:24 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole))
|
2024-08-01 10:20:18 +00:00
|
|
|
r.PATCH("/:id", h.UpdateAddress, middleware.Auth(h.authSvc),
|
2024-06-06 17:54:56 +00:00
|
|
|
middleware.BenefactorAuthorization(entity.UserBenefactorRole))
|
2024-01-22 14:41:55 +00:00
|
|
|
}
|