Documentation ¶
Index ¶
- Variables
- func NewAddressRepository(DB *sqlx.DB) interfaces.AddressRepository
- func NewCartRepository(DB *sqlx.DB) interfaces.CartRepository
- func NewDiscussRepository(DB *sqlx.DB) interfaces.DiscussRepository
- func NewEducationRepository(DB *sqlx.DB) interfaces.EducationRepository
- func NewProductMediaRepository(DB *sqlx.DB) interfaces.ProductMediaRepository
- func NewProductRepository(DB *sqlx.DB) interfaces.ProductRepository
- func NewPropertyRatingRepository(DB *sqlx.DB) interfaces.PropertyRatingRepository
- func NewPropertyRepository(DB *sqlx.DB) interfaces.PropertyRepository
- func NewRatingMediaRepository(DB *sqlx.DB) interfaces.RatingMediaRepository
- func NewRatingRepository(DB *sqlx.DB) interfaces.RatingRepository
- func NewRefreshRepository(DB *sqlx.DB) interfaces.RefreshRepository
- func NewUserRepository(DB *sqlx.DB) interfaces.UserRepository
- func NewWishlistRepository(DB *sqlx.DB) interfaces.WishlistRepository
- type AddressRepository
- func (r *AddressRepository) Create(tx *sqlx.Tx, address *domain.Address) error
- func (r *AddressRepository) Delete(tx *sqlx.Tx, address *domain.Address) error
- func (r *AddressRepository) Read(tx *sqlx.Tx, key string, address *domain.Address) error
- func (r *AddressRepository) Update(tx *sqlx.Tx, address *domain.Address) error
- type CartRepository
- func (r *CartRepository) CountCart(tx *sqlx.Tx, userID string, total *int) error
- func (r *CartRepository) Create(tx *sqlx.Tx, cart *domain.Cart) error
- func (r *CartRepository) Delete(tx *sqlx.Tx, cart *domain.Cart) error
- func (r *CartRepository) GetMyCart(tx *sqlx.Tx, userID, productID string, cart *domain.Cart) error
- func (r *CartRepository) GetMyCartAvailable(tx *sqlx.Tx, userID string, carts *[]response.CartProducts) error
- func (r *CartRepository) GetMyCartUnavailable(tx *sqlx.Tx, userID string, carts *[]response.CartProducts) error
- func (r *CartRepository) Update(tx *sqlx.Tx, cart *domain.Cart) error
- type DiscussRepository
- type EducationRepository
- func (r *EducationRepository) EducationDetails(tx *sqlx.Tx, id string, education *response.EducationData) error
- func (r *EducationRepository) ExceptionWithRandom(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error
- func (r *EducationRepository) GetAllEducation(tx *sqlx.Tx, educations *[]response.EducationsHomePage) error
- func (r *EducationRepository) Latest(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error
- func (r *EducationRepository) MainArticle(tx *sqlx.Tx, id string, education *response.EducationCard) error
- func (r *EducationRepository) MustRead(tx *sqlx.Tx, ids string, educations *[]response.EducationCard) error
- type ProductMediaRepository
- type ProductRepository
- func (r *ProductRepository) Create(tx *sqlx.Tx, product *domain.Product) error
- func (r *ProductRepository) Delete(tx *sqlx.Tx, product *domain.Product) error
- func (r *ProductRepository) GetAllProductsWithPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN string, page int, ...) error
- func (r *ProductRepository) GetAllProductsWithoutPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN string, page, limit int, ...) error
- func (r *ProductRepository) GetDetailsProduct(tx *sqlx.Tx, productID, userID string, product *response.GetProductDetails) error
- func (r *ProductRepository) Read(tx *sqlx.Tx, key string, product *domain.Product) error
- func (r *ProductRepository) Update(tx *sqlx.Tx, product *domain.Product) error
- type PropertyRatingRepository
- type PropertyRepository
- func (r *PropertyRepository) GetAllPropertiesWithPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN, province string, page int, ...) error
- func (r *PropertyRepository) GetAllPropertiesWithoutPromo(tx *sqlx.Tx, categoryName, userID, sortBy, notIN, province string, ...) error
- func (r *PropertyRepository) GetPropertyDetails(tx *sqlx.Tx, propertyID, userID string, property *response.GetPropertyDetails) error
- func (r *PropertyRepository) GetPropertyDiscuss(tx *sqlx.Tx, propertyID string, discuss *[]response.PropertyDiscuss) error
- func (r *PropertyRepository) GetPropertyHighlights(tx *sqlx.Tx, propertyID string, highlights *[]response.PropertyHighlights) error
- func (r *PropertyRepository) GetPropertyMedia(tx *sqlx.Tx, propertyID string, highlights *[]string) error
- func (r *PropertyRepository) GetPropertyRatings(tx *sqlx.Tx, propertyID, userID string, ratings *[]response.RatingProperty) error
- func (r *PropertyRepository) GetState(tx *sqlx.Tx, provinces *[]string) error
- func (r *PropertyRepository) RatingBreakdown(tx *sqlx.Tx, productID string, ratingBreakdown *[]response.RatingBreakdown) error
- type RatingMediaRepository
- type RatingRepository
- func (r *RatingRepository) CountRating(tx *sqlx.Tx, productID string, countRatings *int64) error
- func (r *RatingRepository) GetProductReviews(tx *sqlx.Tx, productID, userID, sortBy string, page int, ...) error
- func (r *RatingRepository) RatingBreakdown(tx *sqlx.Tx, productID string, ratingBreakdown *[]response.RatingBreakdown) error
- type RefreshRepository
- func (r *RefreshRepository) Count(tx *sqlx.Tx, key string, total *int, refresh *domain.Refresh) error
- func (r *RefreshRepository) Create(tx *sqlx.Tx, refresh *domain.Refresh) error
- func (r *RefreshRepository) Delete(tx *sqlx.Tx, refresh *domain.Refresh) error
- func (r *RefreshRepository) Read(tx *sqlx.Tx, key string, refresh *domain.Refresh) error
- func (r *RefreshRepository) ReadDESC(tx *sqlx.Tx, key string, refresh *domain.Refresh) error
- func (r *RefreshRepository) Update(tx *sqlx.Tx, refresh *domain.Refresh) error
- type UserRepository
- func (u *UserRepository) CheckUserExists(tx *sqlx.Tx, user *domain.User) error
- func (r *UserRepository) Create(tx *sqlx.Tx, user *domain.User) error
- func (r *UserRepository) Delete(tx *sqlx.Tx, user *domain.User) error
- func (r *UserRepository) Read(tx *sqlx.Tx, key string, user *domain.User) error
- func (r *UserRepository) Update(tx *sqlx.Tx, user *domain.User) error
- type WishlistRepository
- func (r *WishlistRepository) Create(tx *sqlx.Tx, wishlist *domain.Wishlist) error
- func (r *WishlistRepository) CreateProperty(tx *sqlx.Tx, wishlist *domain.PropertyWishlist) error
- func (r *WishlistRepository) Delete(tx *sqlx.Tx, wishlist *domain.Wishlist) error
- func (r *WishlistRepository) DeleteProperty(tx *sqlx.Tx, wishlist *domain.PropertyWishlist) error
- func (r *WishlistRepository) GetMyWishlists(tx *sqlx.Tx, userID string, wishlists *[]response.MyWishlist) error
- func (r *WishlistRepository) GetMyWishlistsProperty(tx *sqlx.Tx, userID string, wishlists *[]response.MyWishlistProperties) error
- func (r *WishlistRepository) GetSpecificProduct(tx *sqlx.Tx, userID, productID string, wishlist *domain.Wishlist) error
- func (r *WishlistRepository) GetSpecificProperty(tx *sqlx.Tx, userID, propertyID string, wishlist *domain.PropertyWishlist) error
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 */ 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 CartRepository ¶
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
type DiscussRepository ¶
type EducationRepository ¶
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 ¶
func (*ProductMediaRepository) GetProductMedia ¶
type ProductRepository ¶
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
type PropertyRepository ¶
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 (*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 RatingRepository ¶
func (*RatingRepository) CountRating ¶
func (*RatingRepository) GetProductReviews ¶
func (*RatingRepository) RatingBreakdown ¶
func (r *RatingRepository) RatingBreakdown(tx *sqlx.Tx, productID string, ratingBreakdown *[]response.RatingBreakdown) error
type RefreshRepository ¶
type UserRepository ¶
func (*UserRepository) CheckUserExists ¶
type WishlistRepository ¶
func (*WishlistRepository) CreateProperty ¶
func (r *WishlistRepository) CreateProperty(tx *sqlx.Tx, wishlist *domain.PropertyWishlist) 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 (*WishlistRepository) GetSpecificProperty ¶
func (r *WishlistRepository) GetSpecificProperty(tx *sqlx.Tx, userID, propertyID string, wishlist *domain.PropertyWishlist) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.