noticeutils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NoticeQueryActionCount   = "count"
	NoticeQueryActionSum     = "sum"
	NoticeQueryActionAvg     = "avg"
	NoticeQueryActionMin     = "min"
	NoticeQueryActionMax     = "max"
	NoticeQueryActionFind    = "find"
	NoticeQueryActionFindAll = "findAll"
)

Variables

This section is empty.

Functions

func CountReadNotices

func CountReadNotices() int

获取所有已读通知数

func CountReadNoticesForAgent

func CountReadNoticesForAgent(agentId string) int

获取某个Agent已读通知数

func CountReceivedNotices

func CountReceivedNotices(receiverId string, cond map[string]interface{}, minutes int) int

获取某个接收人在某个时间段内接收的通知数

func CountUnreadNotices

func CountUnreadNotices() int

获取所有未读通知数

func CountUnreadNoticesForAgent

func CountUnreadNoticesForAgent(agentId string) int

获取某个Agent的未读通知数

func DeleteNoticesForAgent added in v0.1.2

func DeleteNoticesForAgent(agentId string) error

删除Agent相关通知

func ExistNoticesWithHash added in v0.1.2

func ExistNoticesWithHash(hash string, cond map[string]interface{}, duration time.Duration) bool

计算同样的消息数量

func UpdateNoticeReceivers

func UpdateNoticeReceivers(id primitive.ObjectID, receiverIds []string)

更改某个通知的接收人

Types

type NoticeQuery

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

func NewNoticeQuery

func NewNoticeQuery() *NoticeQuery

func (*NoticeQuery) Action

func (this *NoticeQuery) Action(action NoticeQueryAction) *NoticeQuery

func (*NoticeQuery) Agent

func (this *NoticeQuery) Agent(cond *notices.AgentCond) *NoticeQuery

func (*NoticeQuery) Asc

func (this *NoticeQuery) Asc(field string) *NoticeQuery

func (*NoticeQuery) Attr

func (this *NoticeQuery) Attr(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Count

func (this *NoticeQuery) Count() (count int64, err error)

计算数量

func (*NoticeQuery) Debug

func (this *NoticeQuery) Debug() *NoticeQuery

func (*NoticeQuery) Delete

func (this *NoticeQuery) Delete() error

删除数据

func (*NoticeQuery) Desc

func (this *NoticeQuery) Desc(field string) *NoticeQuery

func (*NoticeQuery) Execute

func (this *NoticeQuery) Execute() (interface{}, error)

开始执行

func (*NoticeQuery) Find

func (this *NoticeQuery) Find() (*notices.Notice, error)

查找单个数据

func (*NoticeQuery) FindAll

func (this *NoticeQuery) FindAll() ([]*notices.Notice, error)

查找多个数据

func (*NoticeQuery) For

func (this *NoticeQuery) For(field string) *NoticeQuery

func (*NoticeQuery) Group

func (this *NoticeQuery) Group(group []string) *NoticeQuery

func (*NoticeQuery) Gt

func (this *NoticeQuery) Gt(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Gte

func (this *NoticeQuery) Gte(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Id

func (this *NoticeQuery) Id(idString string) *NoticeQuery

设置日志ID

func (*NoticeQuery) Insert

func (this *NoticeQuery) Insert(notice *notices.Notice) error

插入新数据

func (*NoticeQuery) Limit

func (this *NoticeQuery) Limit(size int64) *NoticeQuery

func (*NoticeQuery) Lt

func (this *NoticeQuery) Lt(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Lte

func (this *NoticeQuery) Lte(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Not

func (this *NoticeQuery) Not(field string, value interface{}) *NoticeQuery

func (*NoticeQuery) Offset

func (this *NoticeQuery) Offset(offset int64) *NoticeQuery

func (*NoticeQuery) Op

func (this *NoticeQuery) Op(op string, field string, value interface{})

func (*NoticeQuery) Proxy

func (this *NoticeQuery) Proxy(cond *notices.ProxyCond) *NoticeQuery

func (*NoticeQuery) Update

func (this *NoticeQuery) Update(values maps.Map) error

修改数据

type NoticeQueryAction

type NoticeQueryAction = string

Jump to

Keyboard shortcuts

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