repository

package
v0.0.0-...-4c8fc35 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueryGetMainArticle      = "" /* 365-byte string literal not displayed */
	QueryGetMustRead         = "" /* 394-byte string literal not displayed */
	QueryGetLatest           = "" /* 410-byte string literal not displayed */
	QueryGetDiscoverMore     = "" /* 386-byte string literal not displayed */
	QueryGetEducationDetails = "" /* 345-byte string literal not displayed */
)
View Source
var (
	QueryGetPropertyDetails      = "" /* 433-byte string literal not displayed */
	QueryGetPropertyHighlights   = "" /* 140-byte string literal not displayed */
	QueryGetPropertyMedia        = "SELECT pm.photo_url FROM property_media pm WHERE pm.property_id = :property_id"
	QueryGetPropertyDiscuss      = "" /* 526-byte string literal not displayed */
	QueryGetPropertyRatings      = "" /* 589-byte string literal not displayed */
	QueryGetProvinces            = "SELECT DISTINCT p.state FROM properties p"
	QueryRatingPropertyBreakdown = "" /* 185-byte string literal not displayed */
)
View Source
var (
	QueryGetAllPropertiesWithoutCondition1 = "" /* 382-byte string literal not displayed */
	QueryGetAllPropertiesWithoutCondition2 = " FROM properties p INNER JOIN categories c on p.category_id = c.id WHERE 1=1"
	QueryAdditionalForGetAllProperties     = ", IFNULL((SELECT 1 FROM property_wishlist pw WHERE pw.property_id = p.id AND pw.user_id = :user_id), 0) as is_wishlisted"
)
View Source
var (
	QueryGetAllProductsWithoutCondition1 = "" /* 425-byte string literal not displayed */
	QueryGetAllProductsWithoutCondition2 = " FROM products p INNER JOIN categories c ON p.category_id = c.id WHERE p.quantity > 0"
	QueryAdditionalForGetAllProducts     = ", IFNULL((SELECT 1 FROM wishlists w WHERE w.product_id = p.id AND w.user_id = :user_id), 0) as is_wishlisted"
	QueryGetDetailsProduct1              = "" /* 323-byte string literal not displayed */
	QueryGetDetailsProduct2              = " FROM products p INNER JOIN categories c on p.category_id = c.id WHERE p.id = :product_id"
	QueryAdditionalForGetDetailsProduct  = ", IFNULL((SELECT 1 FROM wishlists w WHERE w.product_id = p.id AND w.user_id = :user_id), 0) as is_wishlisted"
	QueryGetProductMedia                 = "SELECT pm.photo_url as url FROM product_media pm WHERE pm.product_id = :product_id ORDER BY pm.created_at"
	QueryGetReviewsProduct1              = "SELECT r.*, u.name, u.photo_url, (SELECT COUNT(*) FROM rating_helpfuls rh WHERE rh.rating_id =  r.id) as helpful_count"
	QueryGetReviewsProduct2              = "" /* 285-byte string literal not displayed */
	QueryAdditionalForGetReviewsProduct  = ", IFNULL((SELECT 1 FROM rating_helpfuls rh WHERE rh.rating_id = r.id AND rh.user_id = :user_id), 0) as is_review_helpful"
	QueryGetMyCartAvailable              = "" /* 459-byte string literal not displayed */
	QueryGetMyCartUnavailable            = "" /* 457-byte string literal not displayed */
	QueryGetSpecificProductInCart        = "SELECT * FROM carts c WHERE product_id = :product_id AND user_id = :user_id"
	QueryGetMyWishlist                   = "" /* 617-byte string literal not displayed */
	QueryGetSpecificProductInWishlist    = "SELECT * FROM wishlists w WHERE user_id = :user_id AND product_id = :product_id"
	QueryGetSpecificPropertyInWishlist   = "SELECT * FROM property_wishlist pw WHERE user_id = :user_id AND property_id = :property_id"
	QueryCountRatings                    = "" /* 129-byte string literal not displayed */
	QueryRatingBreakdown                 = "" /* 178-byte string literal not displayed */
	QueryGetMyPropertiesWishlist         = "" /* 932-byte string literal not displayed */
)
View Source
var (
	QueryGetCountCart = "SELECT COUNT(*) FROM carts c WHERE c.user_id = :user_id"
)
View Source
var (
	QueryGetEducation = "" /* 311-byte string literal not displayed */
)

Functions

func NewAddressRepository

func NewAddressRepository(DB *sqlx.DB) interfaces.AddressRepository

func NewCartRepository

func NewCartRepository(DB *sqlx.DB) interfaces.CartRepository

func NewDiscussRepository

func NewDiscussRepository(DB *sqlx.DB) interfaces.DiscussRepository

func NewEducationRepository

func NewEducationRepository(DB *sqlx.DB) interfaces.EducationRepository

func NewProductMediaRepository

func NewProductMediaRepository(DB *sqlx.DB) interfaces.ProductMediaRepository

func NewProductRepository

func NewProductRepository(DB *sqlx.DB) interfaces.ProductRepository

func NewPropertyRatingRepository

func NewPropertyRatingRepository(DB *sqlx.DB) interfaces.PropertyRatingRepository

func NewPropertyRepository

func NewPropertyRepository(DB *sqlx.DB) interfaces.PropertyRepository

func NewRatingMediaRepository

func NewRatingMediaRepository(DB *sqlx.DB) interfaces.RatingMediaRepository

func NewRatingRepository

func NewRatingRepository(DB *sqlx.DB) interfaces.RatingRepository

func NewRefreshRepository

func NewRefreshRepository(DB *sqlx.DB) interfaces.RefreshRepository

func NewUserRepository

func NewUserRepository(DB *sqlx.DB) interfaces.UserRepository

func NewWishlistRepository

func NewWishlistRepository(DB *sqlx.DB) interfaces.WishlistRepository

Types

type AddressRepository

type AddressRepository struct {
	DB *sqlx.DB
}

func (*AddressRepository) Create

func (r *AddressRepository) Create(tx *sqlx.Tx, address *domain.Address) error

func (*AddressRepository) Delete

func (r *AddressRepository) Delete(tx *sqlx.Tx, address *domain.Address) error

func (*AddressRepository) Read

func (r *AddressRepository) Read(tx *sqlx.Tx, key string, address *domain.Address) error

func (*AddressRepository) Update

func (r *AddressRepository) Update(tx *sqlx.Tx, address *domain.Address) error

type CartRepository

type CartRepository struct {
	DB *sqlx.DB
}

func (*CartRepository) CountCart

func (r *CartRepository) CountCart(tx *sqlx.Tx, userID string, total *int) error

func (*CartRepository) Create

func (r *CartRepository) Create(tx *sqlx.Tx, cart *domain.Cart) error

func (*CartRepository) Delete

func (r *CartRepository) Delete(tx *sqlx.Tx, cart *domain.Cart) error

func (*CartRepository) GetMyCart

func (r *CartRepository) GetMyCart(tx *sqlx.Tx, userID, productID string, cart *domain.Cart) error

func (*CartRepository) GetMyCartAvailable

func (r *CartRepository) GetMyCartAvailable(tx *sqlx.Tx, userID string, carts *[]response.CartProducts) error

func (*CartRepository) GetMyCartUnavailable

func (r *CartRepository) GetMyCartUnavailable(tx *sqlx.Tx, userID string, carts *[]response.CartProducts) error

func (*CartRepository) Update

func (r *CartRepository) Update(tx *sqlx.Tx, cart *domain.Cart) error

type DiscussRepository

type DiscussRepository struct {
	DB *sqlx.DB
}

type EducationRepository

type EducationRepository struct {
	DB *sqlx.DB
}

func (*EducationRepository) EducationDetails

func (r *EducationRepository) EducationDetails(tx *sqlx.Tx, id string, education *response.EducationData) error

func (*EducationRepository) ExceptionWithRandom

func (r *EducationRepository) ExceptionWithRandom(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error

func (*EducationRepository) GetAllEducation

func (r *EducationRepository) GetAllEducation(tx *sqlx.Tx, educations *[]response.EducationsHomePage) error

func (*EducationRepository) Latest

func (r *EducationRepository) Latest(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error

func (*EducationRepository) MainArticle

func (r *EducationRepository) MainArticle(tx *sqlx.Tx, id string, education *response.EducationCard) error

func (*EducationRepository) MustRead

func (r *EducationRepository) MustRead(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error

type ProductMediaRepository

type ProductMediaRepository struct {
	DB *sqlx.DB
}

func (*ProductMediaRepository) GetProductMedia

func (r *ProductMediaRepository) GetProductMedia(tx *sqlx.Tx, productID string, productMedia *[]string) error

type ProductRepository

type ProductRepository struct {
	DB *sqlx.DB
}

func (*ProductRepository) Create

func (r *ProductRepository) Create(tx *sqlx.Tx, product *domain.Product) error

func (*ProductRepository) Delete

func (r *ProductRepository) Delete(tx *sqlx.Tx, product *domain.Product) error

func (*ProductRepository) GetAllProductsWithPromo

func (r *ProductRepository) GetAllProductsWithPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN string, page int, product *[]response.GetProduct) error

func (*ProductRepository) GetAllProductsWithoutPromo

func (r *ProductRepository) GetAllProductsWithoutPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN string, page, limit int, product *[]response.GetProduct) error

func (*ProductRepository) GetDetailsProduct

func (r *ProductRepository) GetDetailsProduct(tx *sqlx.Tx, productID, userID string, product *response.GetProductDetails) error

func (*ProductRepository) Read

func (r *ProductRepository) Read(tx *sqlx.Tx, key string, product *domain.Product) error

func (*ProductRepository) Update

func (r *ProductRepository) Update(tx *sqlx.Tx, product *domain.Product) error

type PropertyRatingRepository

type PropertyRatingRepository struct {
	DB *sqlx.DB
}

type PropertyRepository

type PropertyRepository struct {
	DB *sqlx.DB
}

func (*PropertyRepository) GetAllPropertiesWithPromo

func (r *PropertyRepository) GetAllPropertiesWithPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN, province string, page int, properties *[]response.GetProperties) error

func (*PropertyRepository) GetAllPropertiesWithoutPromo

func (r *PropertyRepository) GetAllPropertiesWithoutPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN, province string, page, limit int, properties *[]response.GetProperties) error

func (*PropertyRepository) GetPropertyDetails

func (r *PropertyRepository) GetPropertyDetails(tx *sqlx.Tx, propertyID, userID string, property *response.GetPropertyDetails) error

func (*PropertyRepository) GetPropertyDiscuss

func (r *PropertyRepository) GetPropertyDiscuss(tx *sqlx.Tx, propertyID string, discuss *[]response.PropertyDiscuss) error

func (*PropertyRepository) GetPropertyHighlights

func (r *PropertyRepository) GetPropertyHighlights(tx *sqlx.Tx, propertyID string, highlights *[]response.PropertyHighlights) error

func (*PropertyRepository) GetPropertyMedia

func (r *PropertyRepository) GetPropertyMedia(tx *sqlx.Tx, propertyID string, highlights *[]string) error

func (*PropertyRepository) GetPropertyRatings

func (r *PropertyRepository) GetPropertyRatings(tx *sqlx.Tx, propertyID, userID string, ratings *[]response.RatingProperty) error

func (*PropertyRepository) GetState

func (r *PropertyRepository) GetState(tx *sqlx.Tx, provinces *[]string) error

func (*PropertyRepository) RatingBreakdown

func (r *PropertyRepository) RatingBreakdown(tx *sqlx.Tx, productID string, ratingBreakdown *[]response.RatingBreakdown) error

type RatingMediaRepository

type RatingMediaRepository struct {
	DB *sqlx.DB
}

type RatingRepository

type RatingRepository struct {
	DB *sqlx.DB
}

func (*RatingRepository) CountRating

func (r *RatingRepository) CountRating(tx *sqlx.Tx, productID string, countRatings *int64) error

func (*RatingRepository) GetProductReviews

func (r *RatingRepository) GetProductReviews(tx *sqlx.Tx, productID, userID, sortBy string, page int, reviews *[]response.Review) error

func (*RatingRepository) RatingBreakdown

func (r *RatingRepository) RatingBreakdown(tx *sqlx.Tx, productID string, ratingBreakdown *[]response.RatingBreakdown) error

type RefreshRepository

type RefreshRepository struct {
	DB *sqlx.DB
}

func (*RefreshRepository) Count

func (r *RefreshRepository) Count(tx *sqlx.Tx, key string, total *int, refresh *domain.Refresh) error

func (*RefreshRepository) Create

func (r *RefreshRepository) Create(tx *sqlx.Tx, refresh *domain.Refresh) error

func (*RefreshRepository) Delete

func (r *RefreshRepository) Delete(tx *sqlx.Tx, refresh *domain.Refresh) error

func (*RefreshRepository) Read

func (r *RefreshRepository) Read(tx *sqlx.Tx, key string, refresh *domain.Refresh) error

func (*RefreshRepository) ReadDESC

func (r *RefreshRepository) ReadDESC(tx *sqlx.Tx, key string, refresh *domain.Refresh) error

func (*RefreshRepository) Update

func (r *RefreshRepository) Update(tx *sqlx.Tx, refresh *domain.Refresh) error

type UserRepository

type UserRepository struct {
	DB *sqlx.DB
}

func (*UserRepository) CheckUserExists

func (u *UserRepository) CheckUserExists(tx *sqlx.Tx, user *domain.User) error

func (*UserRepository) Create

func (r *UserRepository) Create(tx *sqlx.Tx, user *domain.User) error

func (*UserRepository) Delete

func (r *UserRepository) Delete(tx *sqlx.Tx, user *domain.User) error

func (*UserRepository) Read

func (r *UserRepository) Read(tx *sqlx.Tx, key string, user *domain.User) error

func (*UserRepository) Update

func (r *UserRepository) Update(tx *sqlx.Tx, user *domain.User) error

type WishlistRepository

type WishlistRepository struct {
	DB *sqlx.DB
}

func (*WishlistRepository) Create

func (r *WishlistRepository) Create(tx *sqlx.Tx, wishlist *domain.Wishlist) error

func (*WishlistRepository) CreateProperty

func (r *WishlistRepository) CreateProperty(tx *sqlx.Tx, wishlist *domain.PropertyWishlist) error

func (*WishlistRepository) Delete

func (r *WishlistRepository) Delete(tx *sqlx.Tx, wishlist *domain.Wishlist) error

func (*WishlistRepository) DeleteProperty

func (r *WishlistRepository) DeleteProperty(tx *sqlx.Tx, wishlist *domain.PropertyWishlist) error

func (*WishlistRepository) GetMyWishlists

func (r *WishlistRepository) GetMyWishlists(tx *sqlx.Tx, userID string, wishlists *[]response.MyWishlist) error

func (*WishlistRepository) GetMyWishlistsProperty

func (r *WishlistRepository) GetMyWishlistsProperty(tx *sqlx.Tx, userID string, wishlists *[]response.MyWishlistProperties) error

func (*WishlistRepository) GetSpecificProduct

func (r *WishlistRepository) GetSpecificProduct(tx *sqlx.Tx, userID, productID string, wishlist *domain.Wishlist) error

func (*WishlistRepository) GetSpecificProperty

func (r *WishlistRepository) GetSpecificProperty(tx *sqlx.Tx, userID, propertyID string, wishlist *domain.PropertyWishlist) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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