order

package
v0.0.0-...-b6edb1b Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OrderHandler = &Order{}
View Source
var TxRecordHandler = &TxRecord{}

Functions

func CreateTable

func CreateTable()

func Orm

func Orm() *gorm.DB

Types

type Order

type Order struct {
	Id     int64 `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	Status int64 `json:"status" gorm:"column:status;type:int NOT NULL;default:0;comment:'0未支付,1已支付';index"`
	//正常配置
	CreatedAt time.Time  `json:"created_at" gorm:"column:created_at;NOT NULL;default:CURRENT_TIMESTAMP;type:TIMESTAMP"`
	UpdatedAt time.Time  `json:"updated_at" gorm:"column:updated_at;NOT NULL;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;type:TIMESTAMP"`
	DeletedAt *time.Time `json:"deleted_at" gorm:"column:deleted_at;type:DATETIME"`
}

Order 订单表

func (*Order) Delete

func (*Order) Delete(db *gormx.DB, where string, args ...interface{}) error

func (*Order) GetCount

func (*Order) GetCount(where string, args ...interface{}) (int, error)

func (*Order) GetList

func (*Order) GetList(where string, args ...interface{}) ([]*Order, error)

func (*Order) GetListWithLimit

func (*Order) GetListWithLimit(limit int, where string, args ...interface{}) ([]*Order, error)

func (*Order) GetOne

func (*Order) GetOne(where string, args ...interface{}) (*Order, error)

func (*Order) Insert

func (*Order) Insert(db *gormx.DB, data *Order) error

func (*Order) TableName

func (*Order) TableName() string

func (*Order) Update

func (*Order) Update(db *gormx.DB, data map[string]interface{}, where string, args ...interface{}) error

type TxRecord

type TxRecord struct {
	Id      int64  `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	TxId    int64  `json:"tx_id" gorm:"column:tx_id;type:int NOT NULL;default:0;comment:'tx_id';index"`
	MysqlId int64  `json:"mysql_id" gorm:"column:mysql_id;type:int NOT NULL;default:0;comment:'mysql_id';index"`
	Status  int64  `json:"status" gorm:"column:status;type:int NOT NULL;default:0;comment:'status';index"`
	Content string `json:"content" gorm:"column:content;type:varchar(255) NOT NULL;default:'';comment:'事务数据'"`
	//正常配置
	CreatedAt time.Time  `json:"created_at" gorm:"column:created_at;NOT NULL;default:CURRENT_TIMESTAMP;type:TIMESTAMP"`
	UpdatedAt time.Time  `json:"updated_at" gorm:"column:updated_at;NOT NULL;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;type:TIMESTAMP"`
	DeletedAt *time.Time `json:"deleted_at" gorm:"column:deleted_at;type:DATETIME"`
}

事务记录表

func (*TxRecord) Delete

func (*TxRecord) Delete(db *gormx.DB, where string, args ...interface{}) error

func (*TxRecord) GetCount

func (*TxRecord) GetCount(where string, args ...interface{}) (int, error)

func (*TxRecord) GetList

func (*TxRecord) GetList(where string, args ...interface{}) ([]*TxRecord, error)

func (*TxRecord) GetListWithLimit

func (*TxRecord) GetListWithLimit(limit int, where string, args ...interface{}) ([]*TxRecord, error)

func (*TxRecord) GetOne

func (*TxRecord) GetOne(where string, args ...interface{}) (*TxRecord, error)

func (*TxRecord) Insert

func (*TxRecord) Insert(db *gormx.DB, data *TxRecord) error

func (*TxRecord) TableName

func (*TxRecord) TableName() string

func (*TxRecord) Update

func (*TxRecord) Update(db *gormx.DB, data map[string]interface{}, where string, args ...interface{}) error

Jump to

Keyboard shortcuts

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