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 {
	HTTPClient *bm.Client
	// contains filtered or unexported fields
}

Dao struct.

func New

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

New Dao instance.

func (*Dao) AddTask

func (d *Dao) AddTask(ctx context.Context, mid int64, username string, adminID int64, logDate string, contactEmail string, platform int, sourceType int) (lastInsertID int64, err error)

AddTask is add a unique task by mid and state(0).

func (*Dao) AddTaskInfoCache

func (d *Dao) AddTaskInfoCache(c context.Context, mid int64, ti *model.TaskInfo) (err error)

AddTaskInfoCache add taskInfo cache

func (*Dao) Close

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

Close dao resources.

func (*Dao) DeleteTask

func (d *Dao) DeleteTask(ctx context.Context, taskID int64, username string, adminID int64) (err error)

DeleteTask is delete task by TaskID.

func (*Dao) FindTask

func (d *Dao) FindTask(context context.Context, mid int64, state int) (t *model.Task, err error)

FindTask is find task by mid and state.

func (*Dao) GetUIDByNames

func (d *Dao) GetUIDByNames(c context.Context, unames string) (res map[string]int64, err error)

GetUIDByNames is query uids by uname array separated by comma.

func (*Dao) GetUNamesByUids

func (d *Dao) GetUNamesByUids(c context.Context, uids []int64) (res map[int64]string, err error)

GetUNamesByUids is query usernames by uids.

func (*Dao) Ping

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

Ping check db connection.

func (*Dao) QueryArchiveCargo

func (d *Dao) QueryArchiveCargo(c context.Context, statTime time.Time, uids []int64) (items []*model.CargoDetail, err error)

QueryArchiveCargo is query archive audit and receive value.

func (*Dao) QueryTask

func (d *Dao) QueryTask(ctx context.Context, queryStmt string, sort string, offset int, limit int) (tasks []*model.Task, count int64, err error)

QueryTask is query task by condition.

func (*Dao) QueryTaskInfoByIDSQL

func (d *Dao) QueryTaskInfoByIDSQL(c context.Context, id int64) (t *model.TaskInfo, err error)

QueryTaskInfoByIDSQL is query task by task id.

func (*Dao) QueryTaskLog

func (d *Dao) QueryTaskLog(ctx context.Context, queryStmt string, sort string, offset int, limit int) (taskLogs []*model.TaskLog, count int64, err error)

QueryTaskLog is query finished task.

func (*Dao) RemoveTaskInfoCache

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

RemoveTaskInfoCache remove taskInfo cache

func (*Dao) StatArchiveStat

func (d *Dao) StatArchiveStat(c context.Context, business int, typeIDS []int64, uids []int64, statTypes []int64, statDate time.Time) (statNodes []*model.StatNode, err error)

StatArchiveStat is stat archive data.

func (*Dao) StatArchiveStatStream

func (d *Dao) StatArchiveStatStream(c context.Context, business int, typeIDS []int64, uids []int64, statTypes []int64, statDate time.Time) (statNodes []*model.StatNode, err error)

StatArchiveStatStream is stat archive data.

func (*Dao) TaskInfoCache

func (d *Dao) TaskInfoCache(c context.Context, mid int64) (ti *model.TaskInfo, err error)

TaskInfoCache get taskInfo cache

func (*Dao) UpdateTask

func (d *Dao) UpdateTask(ctx context.Context, taskID int64, state int, updateStmt string) (err error)

UpdateTask is update undone task where state = 0.

Jump to

Keyboard shortcuts

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