Documentation ¶
Index ¶
- Variables
- type AdvertService
- func (s *AdvertService) Add(advert *dto.AdvertRequest, userId uuid.UUID) (*dto.Advert, error)
- func (s *AdvertService) AddToSaved(advertId, userId uuid.UUID) error
- func (s *AdvertService) AddViewed(advertId, userId uuid.UUID) error
- func (s *AdvertService) DeleteById(advertId uuid.UUID, userId uuid.UUID) error
- func (s *AdvertService) Get(limit, offset int, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) GetByCartId(cartId, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) GetByCategoryId(categoryId, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) GetById(advertId, userId uuid.UUID) (*dto.AdvertCard, error)
- func (s *AdvertService) GetBySellerId(userId, sellerId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) GetByUserId(userId uuid.UUID) ([]*dto.MyPreviewAdvertCard, error)
- func (s *AdvertService) GetSavedByUserId(userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) RemoveFromSaved(advertId, userId uuid.UUID) error
- func (s *AdvertService) Search(query string, batchSize, limit, offset int, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
- func (s *AdvertService) Update(advert *dto.AdvertRequest, userId uuid.UUID, advertId uuid.UUID) error
- func (s *AdvertService) UpdateStatus(advertId, userId uuid.UUID, status dto.AdvertStatus) error
- func (s *AdvertService) UploadImage(advertId uuid.UUID, imageId uuid.UUID, userId uuid.UUID) error
- type AuthService
- type CartService
- func (c *CartService) AddAdvert(userID, advertID uuid.UUID) error
- func (c *CartService) CheckExists(userID uuid.UUID) (uuid.UUID, error)
- func (c *CartService) DeleteAdvert(cartID uuid.UUID, advertID uuid.UUID) error
- func (c *CartService) GetById(cartID uuid.UUID) (dto.Cart, error)
- func (c *CartService) GetByUserId(userID uuid.UUID) (dto.Cart, error)
- type CategoryService
- type PaymentRequest
- type PaymentResponse
- type PaymentService
- type PromotionService
- type PurchaseService
- type StaticService
- type UserService
- func (u *UserService) ChangePassword(userID uuid.UUID, password *dto.UpdatePassword) error
- func (u *UserService) Delete(userID uuid.UUID) error
- func (u *UserService) Get(userID uuid.UUID) (*dto.User, error)
- func (u *UserService) Login(loginInfo *dto.Login) (uuid.UUID, error)
- func (u *UserService) Signup(signupInfo *dto.Signup) (uuid.UUID, error)
- func (u *UserService) UpdateInfo(user *dto.UserUpdate) error
- func (u *UserService) UploadImage(userID uuid.UUID, imageId uuid.UUID) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AdvertService ¶
type AdvertService struct {
// contains filtered or unexported fields
}
func NewAdvertService ¶
func NewAdvertService(advertRepo repository.AdvertRepository, sellerRepo repository.Seller, userRepo repository.User, historyRepo repository.HistoryRepository, ) *AdvertService
func (*AdvertService) Add ¶
func (s *AdvertService) Add(advert *dto.AdvertRequest, userId uuid.UUID) (*dto.Advert, error)
func (*AdvertService) AddToSaved ¶
func (s *AdvertService) AddToSaved(advertId, userId uuid.UUID) error
func (*AdvertService) AddViewed ¶
func (s *AdvertService) AddViewed(advertId, userId uuid.UUID) error
func (*AdvertService) DeleteById ¶
func (*AdvertService) Get ¶
func (s *AdvertService) Get(limit, offset int, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) GetByCartId ¶
func (s *AdvertService) GetByCartId(cartId, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) GetByCategoryId ¶
func (s *AdvertService) GetByCategoryId(categoryId, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) GetById ¶
func (s *AdvertService) GetById(advertId, userId uuid.UUID) (*dto.AdvertCard, error)
func (*AdvertService) GetBySellerId ¶
func (s *AdvertService) GetBySellerId(userId, sellerId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) GetByUserId ¶
func (s *AdvertService) GetByUserId(userId uuid.UUID) ([]*dto.MyPreviewAdvertCard, error)
func (*AdvertService) GetSavedByUserId ¶
func (s *AdvertService) GetSavedByUserId(userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) RemoveFromSaved ¶
func (s *AdvertService) RemoveFromSaved(advertId, userId uuid.UUID) error
func (*AdvertService) Search ¶
func (s *AdvertService) Search(query string, batchSize, limit, offset int, userId uuid.UUID) ([]*dto.PreviewAdvertCard, error)
func (*AdvertService) Update ¶
func (s *AdvertService) Update(advert *dto.AdvertRequest, userId uuid.UUID, advertId uuid.UUID) error
func (*AdvertService) UpdateStatus ¶
func (s *AdvertService) UpdateStatus(advertId, userId uuid.UUID, status dto.AdvertStatus) error
func (*AdvertService) UploadImage ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(authRepo repository.Session) *AuthService
func (*AuthService) CreateSession ¶
func (a *AuthService) CreateSession(userId uuid.UUID) (string, error)
func (*AuthService) GetUserIdBySession ¶
func (a *AuthService) GetUserIdBySession(session string) (uuid.UUID, error)
func (*AuthService) Logout ¶
func (a *AuthService) Logout(session string) error
type CartService ¶
type CartService struct {
// contains filtered or unexported fields
}
func NewCartService ¶
func NewCartService(cartRepo repository.Cart, advertRepo repository.AdvertRepository) *CartService
func (*CartService) CheckExists ¶
func (*CartService) DeleteAdvert ¶
func (*CartService) GetByUserId ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(categoryRepo repository.CategoryRepository) *CategoryService
type PaymentRequest ¶
type PaymentRequest struct { Amount struct { Value string `json:"value"` Currency string `json:"currency"` } `json:"amount"` Capture bool `json:"capture"` Confirmation struct { Type string `json:"type"` ReturnURL string `json:"return_url"` } `json:"confirmation"` Description string `json:"description"` Metadata struct { OrderID string `json:"order_id"` ItemID string `json:"item_id"` } `json:"metadata"` }
type PaymentResponse ¶
type PaymentService ¶
type PaymentService struct {
// contains filtered or unexported fields
}
func NewPaymentService ¶
func NewPaymentService(paymentShopID, paymentSecret string, paymentRepo repository.PaymentRepository, advertRepo repository.AdvertRepository, promotionRepo repository.PromotionRepository, ) *PaymentService
func (*PaymentService) InitPayment ¶
func (s *PaymentService) InitPayment(itemId string) (*string, error)
func (*PaymentService) PaymentProcessor ¶
func (s *PaymentService) PaymentProcessor(ctx context.Context)
type PromotionService ¶
type PromotionService struct {
// contains filtered or unexported fields
}
func NewPromotionService ¶
func NewPromotionService(promotionRepo repository.PromotionRepository) *PromotionService
func (*PromotionService) GetPromotionInfo ¶
func (s *PromotionService) GetPromotionInfo() (*entity.Promotion, error)
type PurchaseService ¶
type PurchaseService struct {
// contains filtered or unexported fields
}
func NewPurchaseService ¶
func NewPurchaseService(purchaseRepo repository.PurchaseRepository, advertRepo repository.AdvertRepository, cartRepo repository.Cart) *PurchaseService
func (*PurchaseService) Add ¶
func (s *PurchaseService) Add(purchaseRequest dto.PurchaseRequest, userId uuid.UUID) ([]*dto.PurchaseResponse, error)
func (*PurchaseService) GetByUserId ¶
func (s *PurchaseService) GetByUserId(userID uuid.UUID) ([]*dto.PurchaseResponse, error)
type StaticService ¶
type StaticService struct {
// contains filtered or unexported fields
}
func NewStaticService ¶
func NewStaticService(staticRepo repository.StaticRepository) *StaticService
func (*StaticService) GetAvatar ¶
func (s *StaticService) GetAvatar(staticID uuid.UUID) (string, error)
func (*StaticService) GetStaticFile ¶
func (s *StaticService) GetStaticFile(staticURI string) (io.ReadSeeker, error)
func (*StaticService) UploadStatic ¶
func (s *StaticService) UploadStatic(reader io.ReadSeeker) (uuid.UUID, error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(userRepo repository.User, sellerRepo repository.Seller) *UserService
func (*UserService) ChangePassword ¶
func (u *UserService) ChangePassword(userID uuid.UUID, password *dto.UpdatePassword) error
func (*UserService) UpdateInfo ¶
func (u *UserService) UpdateInfo(user *dto.UserUpdate) error
func (*UserService) UploadImage ¶
Click to show internal directories.
Click to hide internal directories.