service

package
v0.0.0-...-52954b5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCategory

func ValidateCategory(categoryServiceURL string, id uint) bool

Types

type ProductService

type ProductService struct {
	DB *gorm.DB
}

func (*ProductService) Create

func (p *ProductService) Create(ctx context.Context, data database.ProductIn) (string, error)

func (*ProductService) Delete

func (p *ProductService) Delete(ctx context.Context, id uint) (string, error)

func (*ProductService) GetByID

func (p *ProductService) GetByID(ctx context.Context, id uint) (database.ProductOut, error)

func (*ProductService) Search

func (p *ProductService) Search(ctx context.Context, search string, category uint, minPrice float32, maxPrice float32, discount bool, sortName string, sortPrice string) ([]database.ProductOut, error)

func (*ProductService) Update

func (p *ProductService) Update(ctx context.Context, id uint, data database.ProductIn) (string, error)

type Service

type Service interface {
	GetByID(ctx context.Context, id uint) (database.ProductOut, error)
	Search(ctx context.Context, search string, category uint, minPrice float32, maxPrice float32, discount bool, sortName string, sortPrice string) ([]database.ProductOut, error)
	Create(ctx context.Context, data database.ProductIn) (string, error)
	Update(ctx context.Context, id uint, data database.ProductIn) (string, error)
	Delete(ctx context.Context, id uint) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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