repo

package
v0.0.0-...-398e551 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("order log already exists")
)

Functions

func NewpDB

func NewpDB(db *gorm.DB) *pDB

func PGConn

func PGConn(dsn string) (*gorm.DB, error)

Types

type ProductRepository

type ProductRepository interface {
	CreateProduct(ctx context.Context, product *models.Product) (int64, error)
	FindOne(ctx context.Context, productId int64) (*models.Product, error)
	UpdateProduct(ctx context.Context, product *models.Product) error
	CreateOrderLog(ctx context.Context, req *StockRequest) error
}

type Repository

type Repository struct {
	ProductRepository
}

func NewProductRepository

func NewProductRepository(db *gorm.DB) *Repository

type StockRequest

type StockRequest struct {
	ProductId int64
	OrderId   int64
	Count     int64
}

Directories

Path Synopsis
Package mock_repo is a generated GoMock package.
Package mock_repo is a generated GoMock package.

Jump to

Keyboard shortcuts

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