interfaces

package
v0.0.0-...-6d4792c Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICartRepository

type ICartRepository interface {
	CartByUserId(userId int) (models.CartModel, error)
	AddProductToCart(userId int, productId int) (bool, error)
	DeleteByUserId(userId int) (bool, error)
}

type ICartService

type ICartService interface {
	AddProductToCart(userId int, productId int) (bool, error)
	GetCart(userId int) (DTO.CartDTO, error)
	DeleteFromCart(userId int) (bool, error)
}

type IDbHandler

type IDbHandler interface {
	Execute(statement string) (sql.Result, error)
	Query(statement string) (IRow, error)
	Connection() *sql.DB
}

type IOrderRepository

type IOrderRepository interface {
	Create(productId int, userId int, name string, price float32) (int, error)
	GetById(orderId int) (models.OrderModel, error)
	Update(model models.OrderModel) (bool, error)
	List(userId int) []models.OrderModel
	GetUnProcessedOrders(status string) []models.OrderModel
}

type IOrderService

type IOrderService interface {
	ProcessNewOrder(cardDTO DTO.CartDTO) (DTO.OrderDTO, error)
	ListOrders(userId int) (DTO.OrdersDTO, error)
	GetById(orderId int) (models.OrderModel, error)
	Update(model models.OrderModel) (bool, error)
	GetUnProcessedOrders(status string) []models.OrderModel
}

type IPayHandler

type IPayHandler interface {
	InitPay(orderId int) (DTO.PayForm, error)
	ProcessPayment(body []byte) (bool, error)
	OneClickPay(orderId int) (bool, error)
	Refund(orderId int) (bool, error)
}

type IProductRepository

type IProductRepository interface {
	GetById(id int) (models.ProductModel, error)
}

type IProductService

type IProductService interface {
	GetProduct(userId int, productId int) (DTO.ProductDTO, error)
	GetById(id int) (models.ProductModel, error)
}

type IRow

type IRow interface {
	Scan(dest ...interface{}) error
	Next() bool
}

type IUserRepository

type IUserRepository interface {
	GetById(id int) (models.UserModel, error)
	Update(user models.UserModel) (bool, error)
}

type IUserService

type IUserService interface {
	GetById(id int) (models.UserModel, error)
	Update(user models.UserModel) (bool, error)
}

Jump to

Keyboard shortcuts

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