foods

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: 9 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 Food

type Food struct {
	Id          int    `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	Description string `json:"description" db:"description"`
	Image       string `json:"image" db:"image"`
	Category    string `json:"category" db:"category"`
}

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) ([]Food, error)
	GetDetail(ctx context.Context, id int) (Food, error)
	Create(ctx context.Context, f Food) (Food, error)
	Update(ctx context.Context, f Food, id int) (Food, error)
	Delete(ctx context.Context, id int) (Food, error)
}

func NewRepository

func NewRepository(db *sqlx.DB, l *logrus.Logger) IRepository

type IService

type IService interface {
	GetAll(ctx context.Context, p getAllRepoParams) ([]Food, error)
	GetDetail(ctx context.Context, id int) (Food, error)
	Create(ctx context.Context, f Food) (Food, error)
	Update(ctx context.Context, f Food, id int) (Food, error)
	Delete(ctx context.Context, id int) (Food, error)
}

func NewService

func NewService(r IRepository, l *logrus.Logger) IService

Jump to

Keyboard shortcuts

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