services

package
v0.0.0-...-5037bb9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartService

type CartService struct {
	// contains filtered or unexported fields
}

func NewCartService

func NewCartService(repo db_repository.CartRepositoryI) *CartService

func (CartService) Create

func (c CartService) Create(cart *requests.CartRequest) (*models.Cart, error)

func (CartService) CreateProduct

func (c CartService) CreateProduct(cart *models.Cart) (*models.Cart, error)

func (CartService) DeleteAllProductFromCart

func (c CartService) DeleteAllProductFromCart(userID int32) error

func (CartService) DeleteProductFromCart

func (c CartService) DeleteProductFromCart(userID int32, productID int) error

func (CartService) GetAllProductsFromCart

func (c CartService) GetAllProductsFromCart(id int32) (*[]models.Cart, error)

func (CartService) GetCart

func (c CartService) GetCart(userID int32) (int, error)

func (CartService) GetCartByUserID

func (c CartService) GetCartByUserID(userID int32) (*models.Cart, error)

func (CartService) Update

type OrderService

type OrderService struct {
	// contains filtered or unexported fields
}

func NewOrderService

func NewOrderService(repo db_repository.OrderRepositoryI) *OrderService

func (OrderService) Create

func (o OrderService) Create(order *requests.OrderRequest) (*models.Order, error)

func (OrderService) GetAll

func (o OrderService) GetAll(userID int32) (*[]models.Order, error)

type ProductService

type ProductService struct {
	// contains filtered or unexported fields
}

func (ProductService) Create

func (p ProductService) Create(product *requests.ProductRequest) (*models.Product, error)

func (ProductService) GetAll

func (p ProductService) GetAll() (*[]models.Product, error)

func (ProductService) GetByName

func (p ProductService) GetByName(name string) (int32, error)

func (ProductService) GetTypes

func (p ProductService) GetTypes() (*[]models.ProductTypes, error)

func (ProductService) GetTypesBySupplier

func (p ProductService) GetTypesBySupplier(supplierID int32) (*[]models.ProductTypes, error)

func (ProductService) Update

func (p ProductService) Update(product *requests.ProductRequest) (*models.Product, error)

type SupplierService

type SupplierService struct {
	// contains filtered or unexported fields
}

func (SupplierService) Create

func (s SupplierService) Create(supplier *requests.SupplierRequest) (*models.Supplier, error)

func (SupplierService) GetAll

func (s SupplierService) GetAll() (*[]models.Supplier, error)

func (SupplierService) GetByName

func (s SupplierService) GetByName(name string) (int32, error)

func (SupplierService) GetTypes

func (s SupplierService) GetTypes() (*[]models.SupplierTypes, error)

type TokenService

type TokenService struct {
	// contains filtered or unexported fields
}

func NewTokenService

func NewTokenService(cfg *conf.ConfigToken, logger *yolo_log.Logger, tokenRepo db_repository.TokensRepositoryI) *TokenService

func (*TokenService) CreateUid

func (t *TokenService) CreateUid(userID int32, uid models.CachedTokens) error

func (*TokenService) DeleteUid

func (t *TokenService) DeleteUid(userID int32) error

func (*TokenService) GenerateAccessToken

func (t *TokenService) GenerateAccessToken(userID int32) (string, string, error)

func (*TokenService) GenerateRefreshToken

func (t *TokenService) GenerateRefreshToken(userID int32) (string, string, error)

func (*TokenService) GetTokenFromBearerString

func (t *TokenService) GetTokenFromBearerString(input string) (string, error)

func (*TokenService) GetUidByID

func (t *TokenService) GetUidByID(claims *helper.JwtCustomClaims) (*models.CachedTokens, error)

func (*TokenService) UpdateUid

func (t *TokenService) UpdateUid(userID int32, uid models.CachedTokens) error

func (*TokenService) ValidateAccessToken

func (t *TokenService) ValidateAccessToken(tokenString string) (*helper.JwtCustomClaims, error)

func (*TokenService) ValidateRefreshToken

func (t *TokenService) ValidateRefreshToken(tokenString string) (*helper.JwtCustomClaims, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(cfg *conf.ConfigToken, logger *yolo_log.Logger, userRepo db_repository.UserRepositoryI) *UserService

func (UserService) Create

func (u UserService) Create(user *requests.UserRequest) (*models.User, error)

func (UserService) EmailExist

func (u UserService) EmailExist(email string) (int, error)

func (UserService) GetByEmail

func (u UserService) GetByEmail(email string) (*models.User, error)

func (UserService) GetByID

func (u UserService) GetByID(id int32) (*models.User, error)

Jump to

Keyboard shortcuts

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