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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string)

PromError .

Types

type Dao

type Dao struct {
	Businesses    map[int64]*model.Business
	BusinessNames map[string]*model.Business
	// contains filtered or unexported fields
}

Dao dao config.

func New

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

New new a Dao and return.

func (*Dao) AddCacheItemCoin

func (d *Dao) AddCacheItemCoin(c context.Context, id int64, val int64, tp int64) (err error)

AddCacheItemCoin Set data to mc

func (*Dao) AddCacheUserCoin

func (d *Dao) AddCacheUserCoin(c context.Context, id int64, val float64) (err error)

AddCacheUserCoin set user coin count

func (*Dao) AddLog

func (d *Dao) AddLog(mid, ts int64, from, to float64, reason, ip, operator string, oid int64, typ int)

AddLog .

func (*Dao) AddedCoins

func (dao *Dao) AddedCoins(c context.Context, mid, upMid int64) (added int64, err error)

AddedCoins get coins added to up_mid.

func (*Dao) BeginTran

func (dao *Dao) BeginTran(c context.Context) (t *sql.Tx, err error)

BeginTran begin a tx.

func (*Dao) CacheItemCoin

func (d *Dao) CacheItemCoin(c context.Context, id int64, tp int64) (res int64, err error)

CacheItemCoin get data from mc

func (*Dao) CacheUserCoin

func (d *Dao) CacheUserCoin(c context.Context, id int64) (res float64, err error)

CacheUserCoin get user coin count.

func (*Dao) CoinList

func (dao *Dao) CoinList(c context.Context, mid, tp, ts, size int64) (rcs []*pb.ModelList, err error)

CoinList return video list of coin added in one month

func (*Dao) CoinLog

func (d *Dao) CoinLog(c context.Context, mid int64) (ls []*pb.ModelLog, err error)

CoinLog .

func (*Dao) CoinsAddedByMid

func (dao *Dao) CoinsAddedByMid(c context.Context, mid, aid, tp int64) (added int64, err error)

CoinsAddedByMid get coin added by mid of aid&tp.

func (*Dao) CoinsAddedCache

func (d *Dao) CoinsAddedCache(c context.Context, mid, aid, tp int64) (added int64, err error)

CoinsAddedCache get coin added of archive.

func (*Dao) Exp

func (d *Dao) Exp(c context.Context, id int64) (res int64, err error)

Exp get data from mc

func (*Dao) ExpireCoinAdded

func (d *Dao) ExpireCoinAdded(c context.Context, mid int64) (ok bool, err error)

ExpireCoinAdded set expire time for coinadded

func (*Dao) IncrCoinAddedCache

func (d *Dao) IncrCoinAddedCache(c context.Context, mid, aid, tp, count int64) (err error)

IncrCoinAddedCache Incr coin added

func (*Dao) InsertCoinArchive

func (dao *Dao) InsertCoinArchive(c context.Context, aid, tp, mid, timestamp, multiply int64) (err error)

InsertCoinArchive .

func (*Dao) InsertCoinMember

func (dao *Dao) InsertCoinMember(c context.Context, aid, tp, mid, timestamp, multiply int64, upMid int64) (err error)

InsertCoinMember .

func (*Dao) ItemCoin

func (d *Dao) ItemCoin(c context.Context, id int64, tp int64) (res int64, err error)

ItemCoin get data from cache if miss will call source method, then add to cache.

func (*Dao) PassportDetail

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

PassportDetail get detail.

func (*Dao) Ping

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

Ping check service health.

func (*Dao) PubBigData

func (d *Dao) PubBigData(c context.Context, aid int64, msg interface{}) (err error)

PubBigData pub msg into databus.

func (*Dao) PubCoinJob

func (d *Dao) PubCoinJob(c context.Context, aid int64, msg interface{}) (err error)

PubCoinJob pub job msg into databus.

func (*Dao) PubStat

func (d *Dao) PubStat(c context.Context, aid, tp, count int64) (err error)

PubStat pub stat msg into databus.

func (*Dao) RawItemCoin

func (dao *Dao) RawItemCoin(c context.Context, aid, tp int64) (count int64, err error)

RawItemCoin get count by aid.

func (*Dao) RawUserCoin

func (d *Dao) RawUserCoin(c context.Context, mid int64) (res float64, err error)

RawUserCoin get user coins.

func (*Dao) SetCoinAddedCache

func (d *Dao) SetCoinAddedCache(c context.Context, mid, aid, tp, count int64) (err error)

SetCoinAddedCache set coin added of archive

func (*Dao) SetCoinAddedsCache

func (d *Dao) SetCoinAddedsCache(c context.Context, mid int64, counts map[int64]int64) (err error)

SetCoinAddedsCache multiset added cache

func (*Dao) SetTodayExpCache

func (d *Dao) SetTodayExpCache(c context.Context, id int64, val int64) (err error)

SetTodayExpCache Set data to mc

func (*Dao) TagIds

func (dao *Dao) TagIds(c context.Context, aid int64) (ids []int64, err error)

TagIds get tag ids from tag

func (*Dao) TxUpdateCoins

func (d *Dao) TxUpdateCoins(c context.Context, tx *xsql.Tx, mid int64, coin float64) (err error)

TxUpdateCoins update coins

func (*Dao) TxUserCoin

func (d *Dao) TxUserCoin(c context.Context, tx *xsql.Tx, mid int64) (count float64, err error)

TxUserCoin tx user coin

func (*Dao) UpdateCoin

func (d *Dao) UpdateCoin(c context.Context, mid int64, coin float64) (err error)

UpdateCoin update user coins.

func (*Dao) UpdateCoinMemberCount

func (dao *Dao) UpdateCoinMemberCount(c context.Context, mid, upMid, count int64) (err error)

UpdateCoinMemberCount for archive

func (*Dao) UpdateCoinSettleBD

func (dao *Dao) UpdateCoinSettleBD(c context.Context, aid, tp, expSub int64, describe string, now time.Time) (affect int64, err error)

UpdateCoinSettleBD update table coin_settle_%d.

func (*Dao) UpdateItemCoinCount

func (dao *Dao) UpdateItemCoinCount(c context.Context, aid, tp, count int64) (err error)

UpdateItemCoinCount update coin_count.

func (*Dao) UpdateItemCoins

func (dao *Dao) UpdateItemCoins(c context.Context, aid, tp, coins int64, now time.Time) (affect int64, err error)

UpdateItemCoins update table coin_archive

func (*Dao) UserCoin

func (d *Dao) UserCoin(c context.Context, id int64) (res float64, err error)

UserCoin get data from cache if miss will call source method, then add to cache.

func (*Dao) UserCoinsAdded

func (dao *Dao) UserCoinsAdded(c context.Context, mid int64) (addeds map[int64]int64, err error)

UserCoinsAdded get user coin added.

type PassportDetail

type PassportDetail struct {
	BindEmail bool  `json:"bind_email"`
	BindTel   bool  `json:"bind_tel"`
	Mid       int64 `json:"mid"`
}

PassportDetail .

Jump to

Keyboard shortcuts

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