dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(uid int32) string

func InitOrderTable

func InitOrderTable(db *gorm.DB) error

Types

type Order

type Order interface {
	InsertOrder(ctx context.Context, od Orders) error
	UpdateOrder(ctx context.Context, od Orders) error
	DeleteOrder(ctx context.Context, sn string, uid int32) error
	SearchOrder(ctx context.Context, od Orders, page int, size int) ([]Orders, error)
	QueryOrderByUid(ctx context.Context, uid, page, size int32) ([]Orders, error)
}

func NewOrder

func NewOrder(db *gorm.DB, logger *zap.Logger) Order

type OrderGoods

type OrderGoods struct {
	Id       int32          `gorm:"type:int;primaryKey;autoIncrement;not null"`
	OrderSn  string         `gorm:"index;not null"`
	GoodsId  int32          `gorm:"type:int;not null"`
	Price    float32        `gorm:"type:decimal(10,2);not null"`
	Nums     int32          `gorm:"type:int;not null"`
	CreateAt int64          `gorm:"type:int;not null"`
	UpdateAt int64          `gorm:"type:int;not null"`
	DeleteAt gorm.DeletedAt `gorm:"type:int;not null"`
}

type Orders

type Orders struct {
	Id       int32          `gorm:"type:int;primaryKey;autoIncrement;not null"`
	UserId   int32          `gorm:"type:int;index;not null"`
	OrderSn  string         `gorm:"type:varchar(50);uniqueIndex;not null"`
	PayType  string         `gorm:"type:varchar(20);not null; comment 'alipay(支付宝), wechat(微信)'"`
	Status   int32          `gorm:"type:int;index;not null;  comment '0(未支付), 1(支付成功), 2(支付失败), 3(超时未支付)'"`
	PayTime  int64          `gorm:"type:int;not null"`
	Amount   float32        `gorm:"type:decimal(10,2);not null"`
	Address  string         `gorm:"type:varchar(255);not null"`
	Phone    string         `gorm:"type:varchar(11);not null"`
	CreateAt int64          `gorm:"type:int;not null"`
	UpdateAt int64          `gorm:"type:int;not null"`
	DeleteAt gorm.DeletedAt `gorm:"type:int;not null"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳