db

package
v0.0.0-...-3ab84a5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CreateOrder

func CreateOrder(ctx context.Context, orders []*Order) error

func Init

func Init()

Init init DB

func UpdateOrder

func UpdateOrder(ctx context.Context, orderId int64, updateMap map[string]interface{}) error

Types

type Order

type Order struct {
	gorm.Model
	OrderId         int64  `json:"order_id"`
	UserId          int64  `json:"user_id"`
	Address         string `json:"address"`
	ProductId       int64  `json:"product_id"`
	StockNum        int64  `json:"stock_num"`
	ProductSnapshot string `json:"product_snapshot"`
	Status          int64  `json:"status"`
}

func GetOrderById

func GetOrderById(ctx context.Context, orderId int64) (*Order, error)

func ListOrders

func ListOrders(ctx context.Context, filterMap map[string]interface{}) ([]*Order, error)

func (*Order) TableName

func (o *Order) TableName() string

Jump to

Keyboard shortcuts

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