service

package
v0.0.0-...-69ebceb Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapInputToOrder

func MapInputToOrder(i input.CreateOrderInput, product model.Product, uid uint) model.Order

func VerifyPassword

func VerifyPassword(hashedPass string, pass string) error

Types

type BuyerService

type BuyerService interface {
	Create(i input.RegisterBuyerInput) (model.Buyer, error)
	BuyerLogin(email string, password string) (string, error)
}

func NewBuyerService

func NewBuyerService(BuyerRepository repository.BuyerRepository) BuyerService

type BuyerServiceImpl

type BuyerServiceImpl struct {
	BuyerRepository repository.BuyerRepository
}

func (*BuyerServiceImpl) BuyerLogin

func (service *BuyerServiceImpl) BuyerLogin(email string, password string) (string, error)

func (*BuyerServiceImpl) Create

func (service *BuyerServiceImpl) Create(i input.RegisterBuyerInput) (model.Buyer, error)

type OrderService

type OrderService interface {
	Create(i input.CreateOrderInput, product model.Product, uid uint) (model.Order, error)
	GetOrderById(id uint) model.Order
	GetOrderListByBuyerId(buyerId uint, limit int, offset int) []model.Order
	GetOrderListBySellerId(sellerId uint, limit int, offset int) []model.Order
	UpdateStatusToAccepted(order model.Order) (model.Order, error)
}

func NewOrderService

func NewOrderService(orderRepository repository.OrderRepository) OrderService

type OrderServiceImpl

type OrderServiceImpl struct {
	OrderRepository repository.OrderRepository
}

func (*OrderServiceImpl) Create

func (service *OrderServiceImpl) Create(i input.CreateOrderInput, product model.Product, uid uint) (model.Order, error)

func (*OrderServiceImpl) GetOrderById

func (service *OrderServiceImpl) GetOrderById(id uint) model.Order

func (*OrderServiceImpl) GetOrderListByBuyerId

func (service *OrderServiceImpl) GetOrderListByBuyerId(buyerId uint, limit int, offset int) []model.Order

func (*OrderServiceImpl) GetOrderListBySellerId

func (service *OrderServiceImpl) GetOrderListBySellerId(sellerId uint, limit int, offset int) []model.Order

func (*OrderServiceImpl) UpdateStatusToAccepted

func (service *OrderServiceImpl) UpdateStatusToAccepted(order model.Order) (model.Order, error)

type ProductService

type ProductService interface {
	Create(i input.CreateProductInput, uid uint) (model.Product, error)
	GetProductList(limit int, offset int) []model.Product
	GetProductById(id uint) model.Product
	GetProductListBySellerId(sellerId uint, limit int, offset int) []model.Product
}

func NewProductService

func NewProductService(ProductRepository repository.ProductRepository) ProductService

type ProductServiceImpl

type ProductServiceImpl struct {
	ProductRepository repository.ProductRepository
}

func (*ProductServiceImpl) Create

func (service *ProductServiceImpl) Create(i input.CreateProductInput, uid uint) (model.Product, error)

func (*ProductServiceImpl) GetProductById

func (service *ProductServiceImpl) GetProductById(id uint) model.Product

func (*ProductServiceImpl) GetProductList

func (service *ProductServiceImpl) GetProductList(limit int, offset int) []model.Product

func (*ProductServiceImpl) GetProductListBySellerId

func (service *ProductServiceImpl) GetProductListBySellerId(sellerId uint, limit int, offset int) []model.Product

type SellerService

type SellerService interface {
	Create(i input.RegisterSellerInput) (model.Seller, error)
	SellerLogin(email string, password string) (string, error)
}

func NewSellerService

func NewSellerService(SellerRepository repository.SellerRepository) SellerService

type SellerServiceImpl

type SellerServiceImpl struct {
	SellerRepository repository.SellerRepository
}

func (SellerServiceImpl) Create

func (SellerServiceImpl) SellerLogin

func (service SellerServiceImpl) SellerLogin(email string, password string) (string, error)

Jump to

Keyboard shortcuts

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