shops

package
v0.0.0-...-cc18f3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoute

func RegisterRoute(s server.Server, c IController)

Types

type FoodShop

type FoodShop struct {
	Id    int     `json:"id" db:"id"`
	Name  string  `json:"name" db:"name"`
	Price float32 `json:"price" db:"price"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL