service

package
v0.0.0-...-dd467ca Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressService

type AddressService interface {
	Create(ctx context.Context, req model.DeliveryAddress) error
	Read(context.Context) (response []model.DeliveryAddress, err error)
	Update(ctx context.Context, req model.DeliveryAddress) (*model.DeliveryAddress, error)
	Delete(ctx context.Context, id string) error
}

func NewAddressService

func NewAddressService(repo repository.AddressRepository, timeout time.Duration) AddressService

type AuthService

type AuthService interface {
	Login(context.Context, model.LoginRequest) (*model.LoginResponse, error)
}

func NewAuthService

func NewAuthService(us UserService, JWTSecret string) AuthService

type CartService

type CartService interface {
	Read(ctx context.Context, userid primitive.ObjectID) ([]model.CartItem, error)
	Update(ctx context.Context, userid primitive.ObjectID, req []model.CartItem) error
	DeleteByItemID(ctx context.Context, userid primitive.ObjectID, itemid primitive.ObjectID) error
}

func NewCartService

func NewCartService(cartRepository repository.CartRepository, timeout time.Duration) CartService

type CategoryService

type CategoryService interface {
	Read(context.Context, model.Paging) ([]model.Category, error)
	Create(ctx context.Context, category model.Category) error
	Update(ctx context.Context, category model.Category) (*model.Category, error)
	Delete(ctx context.Context, id string) error
	ReadByID(ctx context.Context, id string) (*model.Category, error)
}

func NewCategoryService

func NewCategoryService(repo repository.CategoryRepository, timeout time.Duration) CategoryService

type InvoiceService

type InvoiceService interface {
	Read(ctx context.Context, orderid string) (model.Invoice, error)
}

func NewInvoiceService

func NewInvoiceService(
	invoiceRepository repository.InvoiceRepository,
	timeout time.Duration) InvoiceService

type OrderService

type OrderService interface {
	Create(ctx context.Context, req model.CreateOrderRequest) (*model.Order, error)
	Read(ctx context.Context, userid primitive.ObjectID) ([]model.Order, error)
}

func NewOrderService

func NewOrderService(
	orderRepository repository.OrderRepository,
	cartRepository repository.CartRepository,
	deliveryAddressRepository repository.AddressRepository,
	invoiceRepository repository.InvoiceRepository,
	timeout time.Duration) OrderService

type ProductService

type ProductService interface {
	Read(context.Context, model.ReadProductRequest) (products []model.Product, total int64, err error)
	Create(ctx context.Context, product model.ProductRequest) error
	Update(ctx context.Context, product model.ProductRequest) (*model.Product, error)
	Delete(ctx context.Context, id string) error
	ReadByID(ctx context.Context, id string) (*model.Product, error)
}

func NewProductService

func NewProductService(repo repository.ProductRepository, timeout time.Duration) ProductService

type TagService

type TagService interface {
	Read(context.Context, model.Paging) ([]model.Tag, error)
	Create(ctx context.Context, tag model.Tag) error
	Update(ctx context.Context, tag model.Tag) (*model.Tag, error)
	Delete(ctx context.Context, id string) error
	ReadByID(ctx context.Context, id string) (*model.Tag, error)
}

func NewTagService

func NewTagService(repo repository.TagRepository, timeout time.Duration) TagService

type UserService

type UserService interface {
	Read(ctx context.Context) (users []model.User, err error)
	ReadByUsername(ctx context.Context, username string) (user *model.User, err error)
	ReadByEmail(ctx context.Context, email string) (user *model.User, err error)
	Create(ctx context.Context, request model.User) error
}

func NewUserService

func NewUserService(urepo repository.UserRepository, timeout time.Duration) UserService

Jump to

Keyboard shortcuts

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