Documentation ¶
Index ¶
- type Handler
- func (h *Handler) AddAddressToRestaurant(c echo.Context) error
- func (h *Handler) AddFoodToMenu(c echo.Context) error
- func (h *Handler) CreateRestaurant(c echo.Context) error
- func (h *Handler) CurrentUser(c echo.Context) error
- func (h *Handler) DeleteUser(c echo.Context) error
- func (h Handler) GetMenu(c echo.Context) error
- func (h *Handler) GetRestaurant(c echo.Context) error
- func (h *Handler) Login(c echo.Context) error
- func (h *Handler) Register(v1 *echo.Group)
- func (h Handler) RemoveFoodFromMenu(c echo.Context) error
- func (h *Handler) RemoveRestaurantFromUser(c echo.Context) error
- func (h *Handler) Restaurants(c echo.Context) error
- func (h *Handler) SignUp(c echo.Context) error
- func (h *Handler) SignUpCustomer(c echo.Context) error
- func (h *Handler) SignUpOwner(c echo.Context) error
- func (h *Handler) UpdateRestaurant(c echo.Context) error
- func (h *Handler) UpdateUser(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) AddAddressToRestaurant ¶
AddAddressToRestaurant @Summary Replace address Restaurant @Description Replace address Restaurant @Tags Restaurants @Accept json @Produce json @Param id path string true "Id of restaurant" @Param address body requests.AddAddressToRestaurantRequest true "Details of address" @Success 200 {object} responses.RestaurantAddressResponse @Failure default {object} utils.Error @Router /users/restaurants/{id}/address [PUT]
func (*Handler) AddFoodToMenu ¶
AddFoodToMenu @Summary AddFoodToMenu Adds Food to Menu using RestaurantId and Food @Description AddFoodToMenu @Tags Restaurants, Menus @Accept json @Produce json @Param id path string true "Id of restaurant" @Param restaurant body requests.AddFoodToMenuRequest true "Details of food" @Success 200 {object} responses.MenuResponse @Failure default {object} utils.Error @Router /users/restaurants/:id/menus/ [post]
func (*Handler) CreateRestaurant ¶
CreateRestaurant @Summary Create Restaurant @Description Create Restaurant @Tags Restaurants @Accept json @Produce json @Param restaurant body requests.CreateRestaurantRequest true "Details of restaurant" @Success 200 {object} responses.RestaurantResponse @Failure default {object} utils.Error @Router /users/restaurants/ [post]
func (*Handler) CurrentUser ¶
CurrentUser @Summary Get User by id in token @Description Get User by id in token @Tags Users @Accept json @Produce json @Success 200 {object} responses.UserResponse @Failure default {object} utils.Error @Router /users [get] @Security Bearer
func (*Handler) DeleteUser ¶
func (Handler) GetMenu ¶
GetMenu @Summary GetMenu Get menu using restaurantId @Description GetMenu @Tags Restaurants, Menus @Accept json @Produce json @Param id path string true "Id of restaurant" @Success 200 {object} responses.MenuResponse @Failure default {object} utils.Error @Router /users/restaurants/:id/menus/ [get]
func (*Handler) GetRestaurant ¶
GetRestaurant @Summary Get Restaurant by id @Description Get Restaurant by id @Tags Restaurants @Accept json @Produce json @Param id path string true "Id of restaurant" @Success 200 {object} responses.RestaurantResponse @Failure default {object} utils.Error @Router /users/restaurants/{id} [get]
func (*Handler) Login ¶
Login @Summary Login to service @Description Login to service using given credentials @Tags Auth @Accept json @Produce json @Param User body requests.UserLoginRequest true "User credentials" @Success 200 {object} responses.TokenResponse @Failure default {object} utils.Error @Router /auth/login [post]
func (Handler) RemoveFoodFromMenu ¶
RemoveFoodFromMenu @Summary RemoveFoodFromMenu Removes food from Menu using restaurantId and foodId @Description RemoveFoodFromMenu @Tags Restaurants, Menus @Accept json @Produce json @Param id path string true "Id of restaurant" @Param foodId path string true "Id of food" @Success 200 {object} responses.MenuResponse @Failure default {object} utils.Error @Router /users/restaurants/:id/menus/:foodId/ [delete]
func (*Handler) RemoveRestaurantFromUser ¶
RemoveRestaurantFromUser @Summary Remove restaurant from user @Description Remove restaurant from user @Tags Restaurants @Accept json @Produce json @Param id path string true "Id of restaurant" @Success 200 {object} responses.UserRestaurantResponse @Failure default {object} utils.Error @Router /users/restaurants/{id} [delete]
func (*Handler) Restaurants ¶
Restaurant @Summary Get all Restaurant @Description Get all Restaurant @Tags Restaurants @Accept json @Produce json @Success 200 {object} responses.RestaurantResponse @Failure default {object} utils.Error @Router /users/restaurants/ [get]
func (*Handler) SignUp ¶
Signup @Summary Register new user with owner role @Description Register new user in server @Tags Auth @Accept json @Produce json @Param User body requests.UserRegisterRequest true "User credentials" @Success 200 {object} responses.UserResponse @Failure default {object} utils.Error @Router /users [post] @Deprecated
func (*Handler) SignUpCustomer ¶
Signup @Summary Register new user with customer role @Description Register new user in server @Tags Auth @Accept json @Produce json @Param User body requests.UserRegisterRequest true "User credentials" @Success 200 {object} responses.TokenResponse @Failure default {object} utils.Error @Router /auth/customer [post]
func (*Handler) SignUpOwner ¶
Signup @Summary Register new user with owner role @Description Register new user in server @Tags Auth @Accept json @Produce json @Param User body requests.UserRegisterRequest true "User credentials" @Success 200 {object} responses.TokenResponse @Failure default {object} utils.Error @Router /auth/owner [post]
func (*Handler) UpdateRestaurant ¶
UpdateRestaurant @Summary Update Restaurant @Description Update Restaurant @Tags Restaurants @Accept json @Produce json @Param id path string true "Id of restaurant" @Param restaurant body requests.UpdateRestaurantRequest true "Details of restaurant" @Success 200 {object} responses.RestaurantResponse @Failure default {object} utils.Error @Router /users/restaurants/{id} [put]
func (*Handler) UpdateUser ¶
UpdateUser @Summary Update user by id in token @Description Update User by id in token. It can update @Tags Users @Accept json @Produce json @Param User body requests.UserLoginRequest true "User credentials" @Success 200 {object} responses.UserResponse @Failure default {object} utils.Error @Router /users [put]