model

package
v0.0.0-...-0872ad6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type Order

type Order struct {
	Id         int64     `db:"id"`
	Uid        int64     `db:"uid"`    // 用户ID
	Pid        int64     `db:"pid"`    // 产品ID
	Amount     int64     `db:"amount"` // 订单金额
	Status     int64     `db:"status"` // 订单状态
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

type OrderModel

type OrderModel interface {
	Insert(ctx context.Context, data *Order) (sql.Result, error)
	FindOne(ctx context.Context, id int64) (*Order, error)
	FindAllByUid(uid int64) ([]*Order, error)
	Update(ctx context.Context, data *Order) error
	Delete(ctx context.Context, id int64) error
}

func NewOrderModel

func NewOrderModel(conn sqlx.SqlConn, c cache.CacheConf) OrderModel

Jump to

Keyboard shortcuts

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