forked from ebhomengo/niki
1
0
Fork 0
niki/delivery/http_server/benefactor/base/get_all_cities.go

23 lines
521 B
Go
Raw Normal View History

2024-01-18 10:16:36 +00:00
package benefactorbasehandler
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) GetAllCities(c echo.Context) error {
var req addressparam.GetAllCitiesRequest
listCities, err := h.addressSvc.GetAllCities(c.Request().Context(), req)
if err != nil {
msg, code := httpmsg.Error(err)
return echo.NewHTTPError(code, msg)
}
return c.JSON(http.StatusOK, listCities)
}