You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/db/table/relation/statistics.go

31 lines
1.0 KiB

2 years ago
package relation
import "time"
// these two is virtual table just for cms
type ActiveGroup struct {
Name string
ID string `gorm:"column:recv_id"`
MessageNum int `gorm:"column:message_num"`
}
type ActiveUser struct {
Name string
ID string `gorm:"column:send_id"`
MessageNum int `gorm:"column:message_num"`
}
type StatisticsInterface interface {
GetActiveUserNum(from, to time.Time) (num int64, err error)
GetIncreaseUserNum(from, to time.Time) (num int64, err error)
GetTotalUserNum() (num int64, err error)
GetTotalUserNumByDate(to time.Time) (num int64, err error)
GetSingleChatMessageNum(from, to time.Time) (num int64, err error)
GetGroupMessageNum(from, to time.Time) (num int64, err error)
GetIncreaseGroupNum(from, to time.Time) (num int64, err error)
GetTotalGroupNum() (num int64, err error)
GetGroupNum(to time.Time) (num int64, err error)
GetActiveGroups(from, to time.Time, limit int) ([]*ActiveGroup, error)
GetActiveUsers(from, to time.Time, limit int) (activeUsers []*ActiveUser, err error)
}