Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoute ¶
func RegisterRoute(s server.Server, c IController)
Types ¶
type IController ¶
type IController interface { GetAll(ctx echo.Context) error GetDetail(ctx echo.Context) error Create(ctx echo.Context) error Update(ctx echo.Context) error Delete(ctx echo.Context) error }
func NewController ¶
func NewController(s IService, l *logrus.Logger) IController
type IRepository ¶
type IRepository interface { GetAll(ctx context.Context, p getAllRepoParams) ([]Shop, error) GetDetail(ctx context.Context, id int) (Shop, error) Create(ctx context.Context, f Shop) (Shop, error) Update(ctx context.Context, f Shop, id int) (Shop, error) Delete(ctx context.Context, id int) (Shop, error) GetFoodsByShopId(ctx context.Context, id string) ([]FoodShop, error) }
func NewRepository ¶
func NewRepository(db *sqlx.DB, l *logrus.Logger) IRepository
type IService ¶
type IService interface { GetAll(ctx context.Context, p getAllRepoParams) ([]Shop, error) GetDetail(ctx context.Context, id int) (ShopDetail, error) Create(ctx context.Context, f Shop) (Shop, error) Update(ctx context.Context, f Shop, id int) (Shop, error) Delete(ctx context.Context, id int) (Shop, error) }
func NewService ¶
func NewService(r IRepository, l *logrus.Logger) IService
type Shop ¶
type Shop struct { Id int `json:"id" db:"id"` Name string `json:"name" db:"name"` Location string `json:"location" db:"location"` GmapsLink string `json:"gmaps_link" db:"gmaps_link"` Latitude float64 `json:"latitude" db:"latitude"` Longitude float64 `json:"longitude" db:"longitude"` Image string `json:"image" db:"image"` }
type ShopDetail ¶
type ShopDetail struct { Id int `json:"id" db:"id"` Name string `json:"name" db:"name"` Location string `json:"location" db:"location"` GmapsLink string `json:"gmaps_link" db:"gmaps_link"` Latitude float64 `json:"latitude" db:"latitude"` Longitude float64 `json:"longitude" db:"longitude"` Image string `json:"image" db:"image"` Foods []FoodShop `json:"foods" db:"foods"` }
Click to show internal directories.
Click to hide internal directories.