tx

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 TxHandler = &Tx{}

Functions

func CreateTable

func CreateTable()

func Orm

func Orm() *gorm.DB

Types

type Tx

type Tx struct {
	Id     int64 `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	Uid    int64 `json:"uid" gorm:"column:uid;type:int NOT NULL;default:0;comment:'用户id';index"`
	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"`
}

事务记录表

func (*Tx) Delete

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

func (*Tx) GetCount

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

func (*Tx) GetList

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

func (*Tx) GetListWithLimit

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

func (*Tx) GetOne

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

func (*Tx) Insert

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

func (*Tx) TableName

func (*Tx) TableName() string

func (*Tx) Update

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

Jump to

Keyboard shortcuts

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