Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- type BatchUpdateGroupMember
- type BlackModel
- type BlackModelInterface
- type ConversationModel
- type ConversationModelInterface
- type FriendModel
- type FriendModelInterface
- type FriendRequestModel
- type FriendRequestModelInterface
- type GroupMemberModel
- type GroupMemberModelInterface
- type GroupModel
- type GroupModelInterface
- type GroupRequestModel
- type GroupRequestModelInterface
- type GroupSimpleUserID
- type LogInterface
- type LogModel
- type ObjectInfoModelInterface
- type ObjectModel
- type UserModel
- type UserModelInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type BatchUpdateGroupMember ¶
type BlackModel ¶
type BlackModelInterface ¶
type BlackModelInterface interface { Create(ctx context.Context, blacks []*BlackModel) (err error) Delete(ctx context.Context, blacks []*BlackModel) (err error) //UpdateByMap(ctx context.Context, ownerUserID, blockUserID string, args map[string]any) (err error) //Update(ctx context.Context, blacks []*BlackModel) (err error) Find(ctx context.Context, blacks []*BlackModel) (blackList []*BlackModel, err error) Take(ctx context.Context, ownerUserID, blockUserID string) (black *BlackModel, err error) FindOwnerBlacks(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (total int64, blacks []*BlackModel, err error) FindOwnerBlackInfos(ctx context.Context, ownerUserID string, userIDs []string) (blacks []*BlackModel, err error) FindBlackUserIDs(ctx context.Context, ownerUserID string) (blackUserIDs []string, err error) }
type ConversationModel ¶
type ConversationModel struct { OwnerUserID string `bson:"owner_user_id"` ConversationID string `bson:"conversation_id"` ConversationType int32 `bson:"conversation_type"` UserID string `bson:"user_id"` GroupID string `bson:"group_id"` RecvMsgOpt int32 `bson:"recv_msg_opt"` IsPinned bool `bson:"is_pinned"` IsPrivateChat bool `bson:"is_private_chat"` BurnDuration int32 `bson:"burn_duration"` GroupAtType int32 `bson:"group_at_type"` AttachedInfo string `bson:"attached_info"` Ex string `bson:"ex"` MaxSeq int64 `bson:"max_seq"` MinSeq int64 `bson:"min_seq"` CreateTime time.Time `bson:"create_time"` IsMsgDestruct bool `bson:"is_msg_destruct"` MsgDestructTime int64 `bson:"msg_destruct_time"` LatestMsgDestructTime time.Time `bson:"latest_msg_destruct_time"` }
type ConversationModelInterface ¶
type ConversationModelInterface interface { Create(ctx context.Context, conversations []*ConversationModel) (err error) Delete(ctx context.Context, groupIDs []string) (err error) UpdateByMap(ctx context.Context, userIDs []string, conversationID string, args map[string]any) (rows int64, err error) Update(ctx context.Context, conversation *ConversationModel) (err error) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*ConversationModel, err error) FindUserID(ctx context.Context, userIDs []string, conversationIDs []string) ([]string, error) FindUserIDAllConversationID(ctx context.Context, userID string) ([]string, error) Take(ctx context.Context, userID, conversationID string) (conversation *ConversationModel, err error) FindConversationID(ctx context.Context, userID string, conversationIDs []string) (existConversationID []string, err error) FindUserIDAllConversations(ctx context.Context, userID string) (conversations []*ConversationModel, err error) FindRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) ([]string, error) GetUserRecvMsgOpt(ctx context.Context, ownerUserID, conversationID string) (opt int, err error) GetAllConversationIDs(ctx context.Context) ([]string, error) GetAllConversationIDsNumber(ctx context.Context) (int64, error) PageConversationIDs(ctx context.Context, pagination pagination.Pagination) (conversationIDs []string, err error) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*ConversationModel, error) GetConversationIDsNeedDestruct(ctx context.Context) ([]*ConversationModel, error) GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error) }
type FriendModel ¶
type FriendModel struct { OwnerUserID string `bson:"owner_user_id"` FriendUserID string `bson:"friend_user_id"` Remark string `bson:"remark"` CreateTime time.Time `bson:"create_time"` AddSource int32 `bson:"add_source"` OperatorUserID string `bson:"operator_user_id"` Ex string `bson:"ex"` }
FriendModel represents the data structure for a friend relationship in MongoDB.
type FriendModelInterface ¶
type FriendModelInterface interface { // Create inserts multiple friend records. Create(ctx context.Context, friends []*FriendModel) (err error) // Delete removes specified friends of the owner user. Delete(ctx context.Context, ownerUserID string, friendUserIDs []string) (err error) // UpdateByMap updates specific fields of a friend document using a map. UpdateByMap(ctx context.Context, ownerUserID string, friendUserID string, args map[string]any) (err error) // UpdateRemark modify remarks. UpdateRemark(ctx context.Context, ownerUserID, friendUserID, remark string) (err error) // Take retrieves a single friend document. Returns an error if not found. Take(ctx context.Context, ownerUserID, friendUserID string) (friend *FriendModel, err error) // FindUserState finds the friendship status between two users. FindUserState(ctx context.Context, userID1, userID2 string) (friends []*FriendModel, err error) // FindFriends retrieves a list of friends for a given owner. Missing friends do not cause an error. FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*FriendModel, err error) // FindReversalFriends finds users who have added the specified user as a friend. FindReversalFriends(ctx context.Context, friendUserID string, ownerUserIDs []string) (friends []*FriendModel, err error) // FindOwnerFriends retrieves a paginated list of friends for a given owner. FindOwnerFriends(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (total int64, friends []*FriendModel, err error) // FindInWhoseFriends finds users who have added the specified user as a friend, with pagination. FindInWhoseFriends(ctx context.Context, friendUserID string, pagination pagination.Pagination) (total int64, friends []*FriendModel, err error) // FindFriendUserIDs retrieves a list of friend user IDs for a given owner. FindFriendUserIDs(ctx context.Context, ownerUserID string) (friendUserIDs []string, err error) }
FriendModelInterface defines the operations for managing friends in MongoDB.
type FriendRequestModel ¶
type FriendRequestModel struct { FromUserID string `bson:"from_user_id"` ToUserID string `bson:"to_user_id"` HandleResult int32 `bson:"handle_result"` ReqMsg string `bson:"req_msg"` CreateTime time.Time `bson:"create_time"` HandlerUserID string `bson:"handler_user_id"` HandleMsg string `bson:"handle_msg"` HandleTime time.Time `bson:"handle_time"` Ex string `bson:"ex"` }
type FriendRequestModelInterface ¶
type FriendRequestModelInterface interface { // Insert multiple records Create(ctx context.Context, friendRequests []*FriendRequestModel) (err error) // Delete record Delete(ctx context.Context, fromUserID, toUserID string) (err error) // Update with zero values UpdateByMap(ctx context.Context, formUserID string, toUserID string, args map[string]any) (err error) // Update multiple records (non-zero values) Update(ctx context.Context, friendRequest *FriendRequestModel) (err error) // Get friend requests sent to a specific user, no error returned if not found Find(ctx context.Context, fromUserID, toUserID string) (friendRequest *FriendRequestModel, err error) Take(ctx context.Context, fromUserID, toUserID string) (friendRequest *FriendRequestModel, err error) // Get list of friend requests received by toUserID FindToUserID(ctx context.Context, toUserID string, pagination pagination.Pagination) (total int64, friendRequests []*FriendRequestModel, err error) // Get list of friend requests sent by fromUserID FindFromUserID(ctx context.Context, fromUserID string, pagination pagination.Pagination) (total int64, friendRequests []*FriendRequestModel, err error) FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*FriendRequestModel, err error) }
type GroupMemberModel ¶
type GroupMemberModel struct { GroupID string `bson:"group_id"` UserID string `bson:"user_id"` Nickname string `bson:"nickname"` FaceURL string `bson:"face_url"` RoleLevel int32 `bson:"role_level"` JoinTime time.Time `bson:"join_time"` JoinSource int32 `bson:"join_source"` InviterUserID string `bson:"inviter_user_id"` OperatorUserID string `bson:"operator_user_id"` MuteEndTime time.Time `bson:"mute_end_time"` Ex string `bson:"ex"` }
type GroupMemberModelInterface ¶
type GroupMemberModelInterface interface { //NewTx(tx any) GroupMemberModelInterface Create(ctx context.Context, groupMembers []*GroupMemberModel) (err error) Delete(ctx context.Context, groupID string, userIDs []string) (err error) //DeleteGroup(ctx context.Context, groupIDs []string) (err error) Update(ctx context.Context, groupID string, userID string, data map[string]any) (err error) UpdateRoleLevel(ctx context.Context, groupID string, userID string, roleLevel int32) error FindMemberUserID(ctx context.Context, groupID string) (userIDs []string, err error) Take(ctx context.Context, groupID string, userID string) (groupMember *GroupMemberModel, err error) TakeOwner(ctx context.Context, groupID string) (groupMember *GroupMemberModel, err error) SearchMember(ctx context.Context, keyword string, groupID string, pagination pagination.Pagination) (total int64, groupList []*GroupMemberModel, err error) FindRoleLevelUserIDs(ctx context.Context, groupID string, roleLevel int32) ([]string, error) //MapGroupMemberNum(ctx context.Context, groupIDs []string) (count map[string]uint32, err error) //FindJoinUserID(ctx context.Context, groupIDs []string) (groupUsers map[string][]string, err error) FindUserJoinedGroupID(ctx context.Context, userID string) (groupIDs []string, err error) TakeGroupMemberNum(ctx context.Context, groupID string) (count int64, err error) //FindUsersJoinedGroupID(ctx context.Context, userIDs []string) (map[string][]string, error) FindUserManagedGroupID(ctx context.Context, userID string) (groupIDs []string, err error) IsUpdateRoleLevel(data map[string]any) bool }
type GroupModel ¶
type GroupModel struct { GroupID string `bson:"group_id"` GroupName string `bson:"group_name"` Notification string `bson:"notification"` Introduction string `bson:"introduction"` FaceURL string `bson:"face_url"` CreateTime time.Time `bson:"create_time"` Ex string `bson:"ex"` Status int32 `bson:"status"` CreatorUserID string `bson:"creator_user_id"` GroupType int32 `bson:"group_type"` NeedVerification int32 `bson:"need_verification"` LookMemberInfo int32 `bson:"look_member_info"` ApplyMemberFriend int32 `bson:"apply_member_friend"` NotificationUpdateTime time.Time `bson:"notification_update_time"` NotificationUserID string `bson:"notification_user_id"` }
type GroupModelInterface ¶
type GroupModelInterface interface { Create(ctx context.Context, groups []*GroupModel) (err error) UpdateMap(ctx context.Context, groupID string, args map[string]any) (err error) UpdateState(ctx context.Context, groupID string, state int32) (err error) Find(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error) Take(ctx context.Context, groupID string) (group *GroupModel, err error) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*GroupModel, err error) // 获取群总数 CountTotal(ctx context.Context, before *time.Time) (count int64, err error) // 获取范围内群增量 CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) }
type GroupRequestModel ¶
type GroupRequestModel struct { UserID string `bson:"user_id"` GroupID string `bson:"group_id"` HandleResult int32 `bson:"handle_result"` ReqMsg string `bson:"req_msg"` HandledMsg string `bson:"handled_msg"` ReqTime time.Time `bson:"req_time"` HandleUserID string `bson:"handle_user_id"` HandledTime time.Time `bson:"handled_time"` JoinSource int32 `bson:"join_source"` InviterUserID string `bson:"inviter_user_id"` Ex string `bson:"ex"` }
type GroupRequestModelInterface ¶
type GroupRequestModelInterface interface { Create(ctx context.Context, groupRequests []*GroupRequestModel) (err error) Delete(ctx context.Context, groupID string, userID string) (err error) UpdateHandler(ctx context.Context, groupID string, userID string, handledMsg string, handleResult int32) (err error) Take(ctx context.Context, groupID string, userID string) (groupRequest *GroupRequestModel, err error) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) ([]*GroupRequestModel, error) Page(ctx context.Context, userID string, pagination pagination.Pagination) (total int64, groups []*GroupRequestModel, err error) PageGroup(ctx context.Context, groupIDs []string, pagination pagination.Pagination) (total int64, groups []*GroupRequestModel, err error) }
type GroupSimpleUserID ¶
type LogInterface ¶ added in v3.3.2
type LogInterface interface { Create(ctx context.Context, log []*LogModel) error Search(ctx context.Context, keyword string, start time.Time, end time.Time, pagination pagination.Pagination) (int64, []*LogModel, error) Delete(ctx context.Context, logID []string, userID string) error Get(ctx context.Context, logIDs []string, userID string) ([]*LogModel, error) }
type LogModel ¶ added in v3.4.2
type LogModel struct { LogID string `bson:"log_id"` Platform string `bson:"platform"` UserID string `bson:"user_id"` CreateTime time.Time `bson:"create_time"` Url string `bson:"url"` FileName string `bson:"file_name"` SystemType string `bson:"system_type"` Version string `bson:"version"` Ex string `bson:"ex"` }
type ObjectModel ¶
type ObjectModel struct { Name string `bson:"name"` UserID string `bson:"user_id"` Hash string `bson:"hash"` Engine string `bson:"engine"` Key string `bson:"key"` Size int64 `bson:"size"` ContentType string `bson:"content_type"` Group string `bson:"group"` CreateTime time.Time `bson:"create_time"` }
type UserModel ¶
type UserModel struct { UserID string `bson:"user_id"` Nickname string `bson:"nickname"` FaceURL string `bson:"face_url"` Ex string `bson:"ex"` AppMangerLevel int32 `bson:"app_manger_level"` GlobalRecvMsgOpt int32 `bson:"global_recv_msg_opt"` CreateTime time.Time `bson:"create_time"` }
func (*UserModel) GetFaceURL ¶
func (*UserModel) GetNickname ¶
type UserModelInterface ¶
type UserModelInterface interface { Create(ctx context.Context, users []*UserModel) (err error) UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) Find(ctx context.Context, userIDs []string) (users []*UserModel, err error) Take(ctx context.Context, userID string) (user *UserModel, err error) Page(ctx context.Context, pagination pagination.Pagination) (count int64, users []*UserModel, err error) Exist(ctx context.Context, userID string) (exist bool, err error) GetAllUserID(ctx context.Context, pagination pagination.Pagination) (count int64, userIDs []string, err error) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) // 获取用户总数 CountTotal(ctx context.Context, before *time.Time) (count int64, err error) // 获取范围内用户增量 CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) }
Click to show internal directories.
Click to hide internal directories.