Documentation ¶
Index ¶
- type AdvertStorage
- func (ads *AdvertStorage) CheckAdvertOwnership(ctx context.Context, advertID, userID uint) bool
- func (ads *AdvertStorage) CloseAdvert(ctx context.Context, advertID uint) error
- func (ads *AdvertStorage) CreateAdvert(ctx context.Context, files []*multipart.FileHeader, data models.ReceivedAdData) (*models.ReturningAdvert, error)
- func (ads *AdvertStorage) EditAdvert(ctx context.Context, files []*multipart.FileHeader, data models.ReceivedAdData) (*models.ReturningAdvert, error)
- func (ads *AdvertStorage) GetAdvert(ctx context.Context, userID, advertID uint) (*models.ReturningAdvert, error)
- func (ads *AdvertStorage) GetAdvertImagesURLs(ctx context.Context, advertID uint) ([]string, error)
- func (ads *AdvertStorage) GetAdvertOnlyByID(ctx context.Context, advertID uint) (*models.ReturningAdvert, error)
- func (ads *AdvertStorage) GetAdvertsByCategory(ctx context.Context, category, city string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
- func (ads *AdvertStorage) GetAdvertsByCity(ctx context.Context, city string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
- func (ads *AdvertStorage) GetAdvertsForUserWhereStatusIs(ctx context.Context, userID, authorID, deleted, advertNum uint) ([]*models.ReturningAdInList, error)
- func (ads *AdvertStorage) GetPaymnetUUIDList(ctx context.Context, advertID uint) (*models.PaymnetUUIDList, error)
- func (ads *AdvertStorage) GetPriceHistory(ctx context.Context, userID uint) ([]*models.PriceHistoryItem, error)
- func (ads *AdvertStorage) GetPromotionData(ctx context.Context, advertID uint) (*models.Promotion, error)
- func (ads *AdvertStorage) GetSuggestions(ctx context.Context, title string, num uint) ([]string, error)
- func (ads *AdvertStorage) InsertView(ctx context.Context, userID, advertID uint) error
- func (ads *AdvertStorage) SearchAdvertByTitle(ctx context.Context, title string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
- func (ads *AdvertStorage) SetAdvertImages(ctx context.Context, files []*multipart.FileHeader, ...) ([]string, error)
- func (ads *AdvertStorage) YuKassaUpdateDB(ctx context.Context, paymentList *models.PaymentList, advertID uint) error
- func (ads *AdvertStorage) YuKassaUpdateOneRecord(ctx context.Context, uuid string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvertStorage ¶
type AdvertStorage struct {
// contains filtered or unexported fields
}
func NewAdvertStorage ¶
func NewAdvertStorage(pool *pgxpool.Pool, metrics *mymetrics.DatabaseMetrics) *AdvertStorage
func (*AdvertStorage) CheckAdvertOwnership ¶
func (ads *AdvertStorage) CheckAdvertOwnership(ctx context.Context, advertID, userID uint) bool
func (*AdvertStorage) CloseAdvert ¶
func (ads *AdvertStorage) CloseAdvert(ctx context.Context, advertID uint) error
func (*AdvertStorage) CreateAdvert ¶
func (ads *AdvertStorage) CreateAdvert(ctx context.Context, files []*multipart.FileHeader, data models.ReceivedAdData) (*models.ReturningAdvert, error)
func (*AdvertStorage) EditAdvert ¶
func (ads *AdvertStorage) EditAdvert(ctx context.Context, files []*multipart.FileHeader, data models.ReceivedAdData) (*models.ReturningAdvert, error)
func (*AdvertStorage) GetAdvert ¶
func (ads *AdvertStorage) GetAdvert(ctx context.Context, userID, advertID uint) (*models.ReturningAdvert, error)
func (*AdvertStorage) GetAdvertImagesURLs ¶
func (*AdvertStorage) GetAdvertOnlyByID ¶
func (ads *AdvertStorage) GetAdvertOnlyByID(ctx context.Context, advertID uint) (*models.ReturningAdvert, error)
func (*AdvertStorage) GetAdvertsByCategory ¶
func (ads *AdvertStorage) GetAdvertsByCategory(ctx context.Context, category, city string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
func (*AdvertStorage) GetAdvertsByCity ¶
func (ads *AdvertStorage) GetAdvertsByCity(ctx context.Context, city string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
func (*AdvertStorage) GetAdvertsForUserWhereStatusIs ¶
func (ads *AdvertStorage) GetAdvertsForUserWhereStatusIs(ctx context.Context, userID, authorID, deleted, advertNum uint) ([]*models.ReturningAdInList, error)
func (*AdvertStorage) GetPaymnetUUIDList ¶
func (ads *AdvertStorage) GetPaymnetUUIDList(ctx context.Context, advertID uint) (*models.PaymnetUUIDList, error)
func (*AdvertStorage) GetPriceHistory ¶
func (ads *AdvertStorage) GetPriceHistory(ctx context.Context, userID uint) ([]*models.PriceHistoryItem, error)
func (*AdvertStorage) GetPromotionData ¶
func (*AdvertStorage) GetSuggestions ¶
func (*AdvertStorage) InsertView ¶
func (ads *AdvertStorage) InsertView(ctx context.Context, userID, advertID uint) error
func (*AdvertStorage) SearchAdvertByTitle ¶
func (ads *AdvertStorage) SearchAdvertByTitle(ctx context.Context, title string, userID, startID, num uint) ([]*models.ReturningAdInList, error)
func (*AdvertStorage) SetAdvertImages ¶
func (ads *AdvertStorage) SetAdvertImages(ctx context.Context, files []*multipart.FileHeader, originalImageFolderName, resizedImageFolderName string, advertID uint) ([]string, error)
func (*AdvertStorage) YuKassaUpdateDB ¶
func (ads *AdvertStorage) YuKassaUpdateDB(ctx context.Context, paymentList *models.PaymentList, advertID uint) error
ПЕРЕПИСАТЬ ЧЕРЕЗ ПЕРЕСЕЧЕНИЕ МНОЖЕСТВ И BULK UPDATE
func (*AdvertStorage) YuKassaUpdateOneRecord ¶
func (ads *AdvertStorage) YuKassaUpdateOneRecord(ctx context.Context, uuid string) error
ПЕРЕПИСАТЬ ЧЕРЕЗ ПЕРЕСЕЧЕНИЕ МНОЖЕСТВ И BULK UPDATE
Click to show internal directories.
Click to hide internal directories.