dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

func (*Dao) AddPoint

func (d *Dao) AddPoint(c context.Context, p *model.VipPoint) (a int64, err error)

AddPoint addPoint

func (*Dao) AddPointHistory

func (d *Dao) AddPointHistory(c context.Context, ph *model.VipPointChangeHistory) (a int64, err error)

AddPointHistory add point history

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)

BeginTran begin transaction.

func (*Dao) Close

func (dao *Dao) Close()

Close close the resource.

func (*Dao) DelPointInfoCache

func (d *Dao) DelPointInfoCache(c context.Context, mid int64) (err error)

DelPointInfoCache .

func (*Dao) FixPointInfo

func (d *Dao) FixPointInfo(c context.Context, mid int64, pointBalance int64) (a int64, err error)

FixPointInfo fix point data .

func (*Dao) HistoryCount

func (d *Dao) HistoryCount(c context.Context, mid int64, orderID string) (count int64, err error)

HistoryCount check if have repeat record.

func (*Dao) InsertPoint

func (d *Dao) InsertPoint(c context.Context, tx *sql.Tx, pi *model.PointInfo) (a int64, err error)

InsertPoint .

func (*Dao) InsertPointHistory

func (d *Dao) InsertPointHistory(c context.Context, tx *sql.Tx, ph *model.PointHistory) (a int64, err error)

InsertPointHistory .

func (*Dao) LastOneHistory

func (d *Dao) LastOneHistory(c context.Context, mid int64) (point int64, err error)

LastOneHistory last one history.

func (*Dao) MidsByMtime

func (d *Dao) MidsByMtime(c context.Context, mtime time.Time) (pis []*model.PointInfo, err error)

MidsByMtime point mids by mtime.

func (*Dao) Notify

func (d *Dao) Notify(c context.Context, notifyURL string, mid int64, orderID string, ip string) (err error)

Notify point change .

func (*Dao) NotifyCacheDel

func (d *Dao) NotifyCacheDel(c context.Context, notifyURL string, mid int64, ip string) (err error)

NotifyCacheDel notify cache del.

func (*Dao) Ping

func (dao *Dao) Ping(c context.Context) (err error)

Ping dao ping

func (*Dao) TxPointInfo

func (d *Dao) TxPointInfo(c context.Context, tx *sql.Tx, mid int64) (pi *model.PointInfo, err error)

TxPointInfo .

func (*Dao) UpdatePoint

func (d *Dao) UpdatePoint(c context.Context, p *model.VipPoint, oldver int64) (a int64, err error)

UpdatePoint UpdatePoint row

func (*Dao) UpdatePointInfo

func (d *Dao) UpdatePointInfo(c context.Context, tx *sql.Tx, pi *model.PointInfo, ver int64) (a int64, err error)

UpdatePointInfo .

Jump to

Keyboard shortcuts

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