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 ¶
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
Click to show internal directories.
Click to hide internal directories.