mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 10:05:58 +08:00
errcode
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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)
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package unrelation
|
||||
|
||||
import "go.mongodb.org/mongo-driver/mongo"
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
const (
|
||||
CSuperGroup = "super_group"
|
||||
@@ -26,5 +28,11 @@ func (UserToSuperGroupModel) TableName() string {
|
||||
}
|
||||
|
||||
type SuperGroupModelInterface interface {
|
||||
CreateSuperGroup(sCtx mongo.SessionContext, groupID string, initMemberIDs []string) error
|
||||
// tx is your transaction object
|
||||
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...interface{}) error
|
||||
GetSuperGroup(ctx context.Context, groupID string) (SuperGroupModel, error)
|
||||
AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
|
||||
RemoverUserFromSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
|
||||
GetSuperGroupByUserID(ctx context.Context, userID string) (*UserToSuperGroupModel, error)
|
||||
DeleteSuperGroup(ctx context.Context, groupID string, tx ...interface{}) error
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package unrelation
|
||||
|
||||
import "context"
|
||||
|
||||
const (
|
||||
CTag = "tag"
|
||||
CSendLog = "send_log"
|
||||
@@ -29,4 +31,12 @@ func (TagSendLogModel) TableName() string {
|
||||
}
|
||||
|
||||
type TagModelInterface interface {
|
||||
GetUserTags(ctx context.Context, userID string) ([]TagModel, error)
|
||||
CreateTag(ctx context.Context, userID, tagName string, userList []string) error
|
||||
GetTagByID(ctx context.Context, userID, tagID string) (TagModel, error)
|
||||
DeleteTag(ctx context.Context, userID, tagID string) error
|
||||
SetTag(ctx context.Context, userID, tagID, newName string, increaseUserIDList []string, reduceUserIDList []string) error
|
||||
GetUserIDListByTagID(ctx context.Context, userID, tagID string) ([]string, error)
|
||||
SaveTagSendLog(ctx context.Context, tagSendLog *TagSendLogModel) error
|
||||
GetTagSendLogs(ctx context.Context, userID string, showNumber, pageNumber int32) ([]TagSendLogModel, error)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package unrelation
|
||||
|
||||
import "context"
|
||||
|
||||
const (
|
||||
CWorkMoment = "work_moment"
|
||||
)
|
||||
@@ -32,3 +34,15 @@ type Comment struct {
|
||||
func (WorkMoment) TableName() string {
|
||||
return CWorkMoment
|
||||
}
|
||||
|
||||
type WorkMomentModelInterface interface {
|
||||
CreateOneWorkMoment(ctx context.Context, workMoment *WorkMoment) error
|
||||
DeleteOneWorkMoment(ctx context.Context, workMomentID string) error
|
||||
DeleteComment(ctx context.Context, workMomentID, contentID, opUserID string) error
|
||||
GetWorkMomentByID(ctx context.Context, workMomentID string) (*WorkMoment, error)
|
||||
LikeOneWorkMoment(ctx context.Context, likeUserID, userName, workMomentID string) (*WorkMoment, bool, error)
|
||||
CommentOneWorkMoment(ctx context.Context, comment *Comment, workMomentID string) (*WorkMoment, error)
|
||||
GetUserSelfWorkMoments(ctx context.Context, userID string, showNumber, pageNumber int32) ([]*WorkMoment, error)
|
||||
GetUserWorkMoments(ctx context.Context, opUserID, userID string, showNumber, pageNumber int32, friendIDList []string) ([]*WorkMoment, error)
|
||||
GetUserFriendWorkMoments(ctx context.Context, showNumber, pageNumber int32, userID string, friendIDList []string) ([]*WorkMoment, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user