niki/delivery/http_server/benefactor/address/get_all_provinces.go

23 lines
539 B
Go
Raw Normal View History

package benefactoraddresshandler
2024-01-17 20:17:06 +00:00
import (
"net/http"
addressparam "git.gocasts.ir/ebhomengo/niki/param/benefactor/address"
httpmsg "git.gocasts.ir/ebhomengo/niki/pkg/http_msg"
"github.com/labstack/echo/v4"
)
func (h Handler) GetAllProvinces(c echo.Context) error {
var req addressparam.GetAllProvincesRequest
listProvinces, err := h.addressSvc.GetAllProvinces(c.Request().Context(), req)
if err != nil {
msg, code := httpmsg.Error(err)
return echo.NewHTTPError(code, msg)
}
return c.JSON(http.StatusOK, listProvinces)
}