model

package
v0.0.0-...-14505d5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddItem

func AddItem(ctx context.Context, db *gorm.DB, item *Cart) error

func EmptyCart

func EmptyCart(ctx context.Context, db *gorm.DB, userId uint32) error

Types

type Cart

type Cart struct {
	gorm.Model
	UserId    uint32 `gorm:"type:int(11);not null;index:idx_user_id"`
	ProductId uint32 `gorm:"type:int(11);not null;"`
	Qty       uint32 `gorm:"type:int(11);not null;"`
}

func GetCartByUserId

func GetCartByUserId(ctx context.Context, db *gorm.DB, userId uint32) ([]*Cart, error)

func (Cart) TableName

func (Cart) TableName() string

Jump to

Keyboard shortcuts

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