menu

package
v0.0.0-...-bc6e940 Latest Latest
Warning

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

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

Documentation

Overview

Package menu contains the repository implementation for the menu entity

Package menu contains the repository implementation for the menu entity

Package menu contains the repository implementation for the menu entity

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu struct {
	ID          int64     `db:"id" example:"123"`
	Name        string    `db:"name" example:"Hyderabadi Dum Briyani"`
	Description string    `db:"description" example:"Some Description"`
	Price       int       `db:"price" example:"20050"`
	CreatedAt   time.Time `db:"created_at" example:"2021-02-24 20:19:39"`
	UpdatedAt   time.Time `db:"updated_at" example:"2021-02-24 20:19:39"`
	Count       int       `db:"count" example:"3"`
}

Menu is a struct that contains the menu model

func (*Menu) TableName() string

TableName overrides the table name used by User to `users`

type Repository

type Repository struct {
	Store  *sdksql.DB
	Logger *logger.Logger
}

Repository is a struct that contains the database implementation for menu entity

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, newMenu *domainMenu.Menu) (*domainMenu.Menu, error)

Create ... Insert New data

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, id int64) (err error)

Delete ... Delete menu

func (*Repository) GetAll

func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultMenu, error)

GetAll Fetch all menu data

func (*Repository) GetByID

func (r *Repository) GetByID(ctx context.Context, id int64) (*domainMenu.Menu, error)

GetByID ... Fetch only one menu by Id

func (*Repository) GetByTopCount

func (r *Repository) GetByTopCount(ctx context.Context, count int) ([]domainMenu.Menu, error)

GetByTopCount ... Fetch only top menus by count

func (*Repository) GetTotalCount

func (r *Repository) GetTotalCount(ctx context.Context) (int64, error)

GetTotalCount Fetch total menu count

Jump to

Keyboard shortcuts

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