Documentation ¶
Index ¶
- type Cart
- type CartProduct
- type GormRepository
- func (repo *GormRepository) CreateCart(cart cart.Cart) (*cart.Cart, error)
- func (repo *GormRepository) CreateCartProduct(cartProduct cart.CartProduct) (*cart.CartProduct, error)
- func (repo *GormRepository) FindCartByUserID(id int) (*cart.Cart, error)
- func (repo *GormRepository) FindCartProduct(cartID int, productID int) (*cart.CartProduct, error)
- func (repo *GormRepository) FindCartProductByCart(cartID int) ([]cart.CartProduct, error)
- func (repo *GormRepository) SumPrice(cartID int) int
- func (repo *GormRepository) UpdateCart(cart cart.Cart) (*cart.Cart, error)
- func (repo *GormRepository) UpdateCartProduct(cartProduct cart.CartProduct) (*cart.CartProduct, error)
- type SumPrice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cart ¶
type CartProduct ¶
type CartProduct struct { ID uint `gorm:"id;primaryKey;autoIncrement"` CartID uint `gorm:"cart_id"` ProductID uint `gorm:"product_id"` Count int `gorm:"count"` Price int `gorm:"price"` CreatedAt time.Time `gorm:"created_at"` UpdatedAt time.Time `gorm:"updated_at"` DeletedAt *time.Time `gorm:"deleted_at"` }
func (*CartProduct) ToCartProduct ¶
func (col *CartProduct) ToCartProduct() cart.CartProduct
type GormRepository ¶
func NewGormDBRepository ¶
func NewGormDBRepository(db *gorm.DB) *GormRepository
func (*GormRepository) CreateCart ¶
func (*GormRepository) CreateCartProduct ¶
func (repo *GormRepository) CreateCartProduct(cartProduct cart.CartProduct) (*cart.CartProduct, error)
func (*GormRepository) FindCartByUserID ¶
func (repo *GormRepository) FindCartByUserID(id int) (*cart.Cart, error)
func (*GormRepository) FindCartProduct ¶
func (repo *GormRepository) FindCartProduct(cartID int, productID int) (*cart.CartProduct, error)
func (*GormRepository) FindCartProductByCart ¶
func (repo *GormRepository) FindCartProductByCart(cartID int) ([]cart.CartProduct, error)
func (*GormRepository) SumPrice ¶
func (repo *GormRepository) SumPrice(cartID int) int
func (*GormRepository) UpdateCart ¶
func (*GormRepository) UpdateCartProduct ¶
func (repo *GormRepository) UpdateCartProduct(cartProduct cart.CartProduct) (*cart.CartProduct, error)
Click to show internal directories.
Click to hide internal directories.