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

31 lines
798 B
Go
Raw Normal View History

package benefactoraddresshandler
2024-01-18 10:16:36 +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"
)
2024-05-14 13:07:09 +00:00
// GetAllCities godoc
// @Summary get all cities
2024-05-15 07:38:39 +00:00
// @Tags address
2024-05-14 13:07:09 +00:00
// @Accept json
// @Produce json
// @Success 200 {object} addressparam.GetAllCitiesResponse
// @Failure 400 {string} "Bad request"
// @Router /address/cities [get]
2024-01-18 10:16:36 +00:00
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)
}