Documentation
¶
Index ¶
- type Product
- type ProductRequest
- type Restaurant
- type RestaurantHandler
- func (h *RestaurantHandler) CreateRestaurant(ctx *gin.Context)
- func (h *RestaurantHandler) GetActiveRestaurant(ctx *gin.Context)
- func (h *RestaurantHandler) GetRestaurantById(ctx *gin.Context)
- func (h *RestaurantHandler) SearchRestaurant(ctx *gin.Context)
- func (h *RestaurantHandler) UpdateRestaurant(ctx *gin.Context)
- func (h *RestaurantHandler) UpdateRestaurantStatus(ctx *gin.Context)
- type RestaurantRepo
- type RestaurantRequest
- type RestaurantResponse
- type RestaurantService
- func (s *RestaurantService) CreateRestaurant(req RestaurantRequest, createdBy int) error
- func (s *RestaurantService) GetActiveRestaurant(req SearchRequest) (shared.PaginationResponse, error)
- func (s *RestaurantService) GetRestaurantByID(resId int, productsIDs []int) (Restaurant, error)
- func (s *RestaurantService) SearchRestaurant(req SearchRequest) (Restaurant, error)
- func (s *RestaurantService) UpdateRestaurant(req RestaurantRequest, updatedBy int) error
- func (s *RestaurantService) UpdateRestaurantStatus(req RestaurantRequest, updatedBy int) error
- type SearchRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductRequest ¶
type Restaurant ¶
type RestaurantHandler ¶
type RestaurantHandler struct {
// contains filtered or unexported fields
}
func NewRestaurantHandler ¶
func NewRestaurantHandler(service RestaurantService) *RestaurantHandler
func (*RestaurantHandler) CreateRestaurant ¶
func (h *RestaurantHandler) CreateRestaurant(ctx *gin.Context)
func (*RestaurantHandler) GetActiveRestaurant ¶
func (h *RestaurantHandler) GetActiveRestaurant(ctx *gin.Context)
func (*RestaurantHandler) GetRestaurantById ¶
func (h *RestaurantHandler) GetRestaurantById(ctx *gin.Context)
func (*RestaurantHandler) SearchRestaurant ¶
func (h *RestaurantHandler) SearchRestaurant(ctx *gin.Context)
func (*RestaurantHandler) UpdateRestaurant ¶
func (h *RestaurantHandler) UpdateRestaurant(ctx *gin.Context)
func (*RestaurantHandler) UpdateRestaurantStatus ¶
func (h *RestaurantHandler) UpdateRestaurantStatus(ctx *gin.Context)
type RestaurantRepo ¶
type RestaurantRepo interface {
// admin method
Create(restaurant Restaurant, createdBy int) error
Update(restaurant Restaurant, updatedBy int) error
UpdateStatus(restaurant Restaurant, updatedBy int) error
Search(query string, limit, offset int, status bool) (shared.PaginationResponse, error)
GetResProducts(ids ...int) ([]Product, error)
GetProductsByID(restID int, ids []int) ([]Product, error)
GetByID(id int64) (Restaurant, error)
}
func NewRestaurantRepo ¶
func NewRestaurantRepo(db *sqlx.DB) RestaurantRepo
type RestaurantRequest ¶
type RestaurantRequest struct {
ID int64 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
Status bool `json:"status" form:"status"`
Lon float64 `json:"lon" form:"lon"`
Lat float64 `json:"lat" form:"lat"`
Address string `json:"address" form:"address"`
}
func (*RestaurantRequest) FromRestaurantRequest ¶
func (r *RestaurantRequest) FromRestaurantRequest() Restaurant
func (*RestaurantRequest) Validate ¶
func (r *RestaurantRequest) Validate() error
type RestaurantResponse ¶
type RestaurantResponse struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status bool `json:"status"`
Lon float64 `json:"lon"`
Lat float64 `json:"lat"`
Address string `json:"address"`
}
func (*RestaurantResponse) FromRestaurant ¶
func (r *RestaurantResponse) FromRestaurant(restaurant *Restaurant)
type RestaurantService ¶
type RestaurantService struct {
// contains filtered or unexported fields
}
func NewRestaurantService ¶
func NewRestaurantService(repo RestaurantRepo) RestaurantService
func (*RestaurantService) CreateRestaurant ¶
func (s *RestaurantService) CreateRestaurant(req RestaurantRequest, createdBy int) error
func (*RestaurantService) GetActiveRestaurant ¶
func (s *RestaurantService) GetActiveRestaurant(req SearchRequest) (shared.PaginationResponse, error)
func (*RestaurantService) GetRestaurantByID ¶
func (s *RestaurantService) GetRestaurantByID(resId int, productsIDs []int) (Restaurant, error)
func (*RestaurantService) SearchRestaurant ¶
func (s *RestaurantService) SearchRestaurant(req SearchRequest) (Restaurant, error)
func (*RestaurantService) UpdateRestaurant ¶
func (s *RestaurantService) UpdateRestaurant(req RestaurantRequest, updatedBy int) error
func (*RestaurantService) UpdateRestaurantStatus ¶
func (s *RestaurantService) UpdateRestaurantStatus(req RestaurantRequest, updatedBy int) error
Click to show internal directories.
Click to hide internal directories.