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

Documentation

Index

Constants

View Source
const (
	BusStCreated    = int8(1) // 未处理
	BusStRead       = int8(2) // 已回复已读
	BusStAutoClosed = int8(5) // 过期自动关闭
	BusStNotRead    = int8(6) // 已回复未读
)

consts for workflow business_state

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {

	// orm
	WriteORM *gorm.DB
	ReadORM  *gorm.DB
	// contains filtered or unexported fields
}

Dao struct info of Dao.

func New

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

New new a Dao and return.

func (*Dao) Appeals

func (d *Dao) Appeals(c context.Context, ids []int64) (appeals []*model.Appeal, err error)

Appeals .

func (*Dao) BusinessAttr

func (d *Dao) BusinessAttr(c context.Context) (res []*model.BusinessAttr, err error)

BusinessAttr .

func (*Dao) ChallByIDs

func (d *Dao) ChallByIDs(c context.Context, cids []int64) (res map[int64]*model.Chall, err error)

ChallByIDs get chall list by ids.

func (*Dao) Close

func (d *Dao) Close() (err error)

Close close connections of ORM.

func (*Dao) DelRelatedMissions

func (d *Dao) DelRelatedMissions(ctx context.Context, bid, transAdmin int, ids []int64) (err error)

DelRelatedMissions .

func (*Dao) DelSingleExpire

func (d *Dao) DelSingleExpire(c context.Context, bid int, ids []int64) (err error)

DelSingleExpire .

func (*Dao) DelUperInfo

func (d *Dao) DelUperInfo(c context.Context, mids []int64) (err error)

DelUperInfo .

func (*Dao) ExistKey

func (d *Dao) ExistKey(c context.Context, key string) (exist bool, err error)

ExistKey .

func (*Dao) IsCrash

func (d *Dao) IsCrash(c context.Context) (exist bool, err error)

IsCrash .

func (*Dao) LastEvent

func (d *Dao) LastEvent(id int64) (e *model.Event, err error)

LastEvent return last event of appeal_id

func (*Dao) Ping

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

Ping ping health of ORM.

func (*Dao) SearchAppeal

func (d *Dao) SearchAppeal(c context.Context, cond model.AppealSearchCond) (res *model.AppealSearchRes, err error)

SearchAppeal .

func (*Dao) SearchChall

func (d *Dao) SearchChall(c context.Context, params *model.SearchParams) (res *model.ChallSearchCommonRes, err error)

SearchChall .

func (*Dao) SendMessage

func (d *Dao) SendMessage(c context.Context, chs []*model.ChallRes, msg *param.MessageParam) (err error)

SendMessage .

func (*Dao) SetAppealAssignState

func (d *Dao) SetAppealAssignState(c context.Context, ids []int64, assignState int8) (err error)

SetAppealAssignState .

func (*Dao) SetAppealTransferState

func (d *Dao) SetAppealTransferState(c context.Context, ids []int64, transferState int8) (err error)

SetAppealTransferState will close expired feedback 关闭超时的申诉 (用户未评价)

func (*Dao) SetCrash

func (d *Dao) SetCrash(c context.Context) (err error)

SetCrash .

func (*Dao) SetList

func (d *Dao) SetList(c context.Context, key string, ids []int64) (err error)

SetList .

func (*Dao) SetString

func (d *Dao) SetString(c context.Context, key, val string) (err error)

SetString .

func (*Dao) SetWeightSortedSet

func (d *Dao) SetWeightSortedSet(c context.Context, bid int, newWeight map[int64]int64) (err error)

SetWeightSortedSet 覆盖sorted set

func (*Dao) SingleExpire

func (d *Dao) SingleExpire(c context.Context, bid int) (delIDs []int64, err error)

SingleExpire 获取所有的 single expire 信息

func (*Dao) TxSetWeight

func (d *Dao) TxSetWeight(tx *gorm.DB, newWeight map[int64]int64) (err error)

TxSetWeight db覆盖权重值

func (*Dao) UpDispatchStateAdminIDByIds

func (d *Dao) UpDispatchStateAdminIDByIds(c context.Context, cids []int64, dispatchState, assignAdminid int64) (err error)

UpDispatchStateAdminIDByIds .

func (*Dao) UpDispatchStateByIDs

func (d *Dao) UpDispatchStateByIDs(c context.Context, cids []int64, dispatchState int64) (err error)

UpDispatchStateByIDs update by ids.

func (*Dao) UperInfoCache

func (d *Dao) UperInfoCache(c context.Context, apIDs []int64) (params []int64, err error)

UperInfoCache 读取用户维度的申诉weight计算参数

Jump to

Keyboard shortcuts

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