model

package
v0.0.0-...-2d053d8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddGoodsMsg

type AddGoodsMsg struct {
	Uid   int64
	Goods *GoodInfo
}

type Cart

type Cart struct {
	UserId  int64
	SkuJson string
}

type CartJson

type CartJson struct {
	// []store
	Store []Store `json:"store"`
}

CartJson DBSkuJson

func (*CartJson) GetRecentNStores

func (cart *CartJson) GetRecentNStores(n int) *CartJson

GetRecentNStores 获得CartJson中前n个店铺

func (*CartJson) InsertSku

func (cart *CartJson) InsertSku(info *GoodInfo)

InsertSku 将sku插入json,如果sku已存在则增加count

func (*CartJson) SortStoresByUpdatedAt

func (cart *CartJson) SortStoresByUpdatedAt()

SortStoresByUpdatedAt 对CartJson进行降序排序(最近的时间在前)

type GoodInfo

type GoodInfo struct {
	SkuId  int64
	ShopId int64
	Count  int64
}

type Sku

type Sku struct {
	SkuID int64 `json:"sku_id"`
	Count int64 `json:"count"`
}

type Store

type Store struct {
	// []goods
	Goods     []Sku     `json:"sku"`
	StoreID   int64     `json:"store_id"`
	UpdatedAt time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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