db

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBase

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

func NewDataBase

func NewDataBase(ctx context.Context, loginUserID string, dbDir string, logLevel int) (*DataBase, error)

func (*DataBase) AddMemberCount

func (d *DataBase) AddMemberCount(ctx context.Context, groupID string) error

func (*DataBase) BatchInsertConversationList

func (d *DataBase) BatchInsertConversationList(ctx context.Context, conversationList []*model_struct.LocalConversation) error

func (*DataBase) BatchInsertConversationUnreadMessageList

func (d *DataBase) BatchInsertConversationUnreadMessageList(ctx context.Context, messageList []*model_struct.LocalConversationUnreadMessage) error

func (*DataBase) BatchInsertExceptionMsg

func (d *DataBase) BatchInsertExceptionMsg(ctx context.Context, messageList []*model_struct.LocalErrChatLog) error

func (*DataBase) BatchInsertExceptionMsgController

func (d *DataBase) BatchInsertExceptionMsgController(ctx context.Context, messageList []*model_struct.LocalErrChatLog) error

func (*DataBase) BatchInsertGroupMember

func (d *DataBase) BatchInsertGroupMember(ctx context.Context, groupMemberList []*model_struct.LocalGroupMember) error

func (*DataBase) BatchInsertMessageList

func (d *DataBase) BatchInsertMessageList(ctx context.Context, conversationID string, MessageList []*model_struct.LocalChatLog) error

func (*DataBase) BatchInsertTempCacheMessageList

func (d *DataBase) BatchInsertTempCacheMessageList(ctx context.Context, MessageList []*model_struct.TempCacheLocalChatLog) error

func (*DataBase) BatchUpdateConversationList

func (d *DataBase) BatchUpdateConversationList(ctx context.Context, conversationList []*model_struct.LocalConversation) error

func (*DataBase) ClearConversation

func (d *DataBase) ClearConversation(ctx context.Context, conversationID string) error

Clear the conversation, which is used to delete the conversation history message and clear the conversation at the same time. The GetAllConversation or GetConversationListSplit interface can still be obtained, but there is no latest message.

func (*DataBase) ClearWorkMomentsNotification

func (d *DataBase) ClearWorkMomentsNotification(ctx context.Context) (err error)

func (*DataBase) Close

func (d *DataBase) Close(ctx context.Context) error

func (*DataBase) ConversationIfExists

func (d *DataBase) ConversationIfExists(ctx context.Context, conversationID string) (bool, error)

func (*DataBase) DecrConversationUnreadCount

func (d *DataBase) DecrConversationUnreadCount(ctx context.Context, conversationID string, count int64) (err error)

func (*DataBase) DeleteAdminGroupRequest

func (d *DataBase) DeleteAdminGroupRequest(ctx context.Context, groupID, userID string) error

func (*DataBase) DeleteAllMessage

func (d *DataBase) DeleteAllMessage(ctx context.Context) error

func (*DataBase) DeleteAllSuperGroup

func (d *DataBase) DeleteAllSuperGroup(ctx context.Context) error

func (*DataBase) DeleteBlack

func (d *DataBase) DeleteBlack(ctx context.Context, blockUserID string) error

func (*DataBase) DeleteConversation

func (d *DataBase) DeleteConversation(ctx context.Context, conversationID string) error

func (*DataBase) DeleteConversationAllMessages

func (d *DataBase) DeleteConversationAllMessages(ctx context.Context, conversationID string) error

func (*DataBase) DeleteConversationMsgs

func (d *DataBase) DeleteConversationMsgs(ctx context.Context, conversationID string, msgIDs []string) error

func (*DataBase) DeleteConversationMsgsBySeqs

func (d *DataBase) DeleteConversationMsgsBySeqs(ctx context.Context, conversationID string, seqs []int64) error

func (*DataBase) DeleteConversationUnreadMessageList

func (d *DataBase) DeleteConversationUnreadMessageList(ctx context.Context, conversationID string, sendTime int64) int64

func (*DataBase) DeleteExpireUpload

func (d *DataBase) DeleteExpireUpload(ctx context.Context) error

func (*DataBase) DeleteFriendDB

func (d *DataBase) DeleteFriendDB(ctx context.Context, friendUserID string) error

func (*DataBase) DeleteFriendRequestBothUserID

func (d *DataBase) DeleteFriendRequestBothUserID(ctx context.Context, fromUserID, toUserID string) error

func (*DataBase) DeleteGroup

func (d *DataBase) DeleteGroup(ctx context.Context, groupID string) error

func (*DataBase) DeleteGroupAllMembers

func (d *DataBase) DeleteGroupAllMembers(ctx context.Context, groupID string) error

func (*DataBase) DeleteGroupMember

func (d *DataBase) DeleteGroupMember(ctx context.Context, groupID, userID string) error

func (*DataBase) DeleteGroupRequest

func (d *DataBase) DeleteGroupRequest(ctx context.Context, groupID, userID string) error

func (*DataBase) DeleteMessageReactionExtension

func (d *DataBase) DeleteMessageReactionExtension(ctx context.Context, msgID string) error
func (d *DataBase) GetAndUpdateMessageReactionExtension(ctx context.Context, msgID string, m map[string]*sdkws.KeyValue) error {
	d.mRWMutex.Lock()
	defer d.mRWMutex.Unlock()
	var temp model_struct.LocalChatLogReactionExtensions
	err := d.conn.WithContext(ctx).Where("client_msg_id = ?",
		msgID).Take(&temp).Error
	if err != nil {
		temp.ClientMsgID = msgID
		temp.LocalReactionExtensions = []byte(utils.StructToJsonString(m))
		return d.conn.WithContext(ctx).Create(&temp).Error
	} else {
		oldKeyValue := make(map[string]*sdkws.KeyValue)
		err = json.Unmarshal(temp.LocalReactionExtensions, &oldKeyValue)
		if err != nil {
			log.Error("special handle", err.Error())
		}
		log.Warn("special handle", oldKeyValue)
		for k, newValue := range m {
			oldKeyValue[k] = newValue
		}
		temp.LocalReactionExtensions = []byte(utils.StructToJsonString(oldKeyValue))
		t := d.conn.WithContext(ctx).Updates(temp)
		if t.RowsAffected == 0 {
			return utils.Wrap(errors.New("RowsAffected == 0"), "no update")
		}
	}
	return nil
}

func (*DataBase) DeleteSendingMessage

func (d *DataBase) DeleteSendingMessage(ctx context.Context, conversationID, clientMsgID string) error

func (*DataBase) DeleteSuperGroup

func (d *DataBase) DeleteSuperGroup(ctx context.Context, groupID string) error

func (*DataBase) DeleteUpload

func (d *DataBase) DeleteUpload(ctx context.Context, partHash string) error

func (*DataBase) FindAllConversationConversationID

func (d *DataBase) FindAllConversationConversationID(ctx context.Context) (conversationIDs []string, err error)

func (*DataBase) GetAbnormalMsgSeq

func (d *DataBase) GetAbnormalMsgSeq(ctx context.Context) (int64, error)

func (*DataBase) GetAbnormalMsgSeqList

func (d *DataBase) GetAbnormalMsgSeqList(ctx context.Context) ([]int64, error)

func (*DataBase) GetAdminGroupApplication

func (d *DataBase) GetAdminGroupApplication(ctx context.Context) ([]*model_struct.LocalAdminGroupRequest, error)

func (*DataBase) GetAllConversationIDList

func (d *DataBase) GetAllConversationIDList(ctx context.Context) (result []string, err error)

func (*DataBase) GetAllConversationListDB

func (d *DataBase) GetAllConversationListDB(ctx context.Context) ([]*model_struct.LocalConversation, error)

func (*DataBase) GetAllConversations

func (d *DataBase) GetAllConversations(ctx context.Context) ([]*model_struct.LocalConversation, error)

func (*DataBase) GetAllFriendList

func (d *DataBase) GetAllFriendList(ctx context.Context) ([]*model_struct.LocalFriend, error)

func (*DataBase) GetAllGroupInfoByGroupIDOrGroupName

func (d *DataBase) GetAllGroupInfoByGroupIDOrGroupName(ctx context.Context, keyword string, isSearchGroupID bool, isSearchGroupName bool) ([]*model_struct.LocalGroup, error)

func (*DataBase) GetAllGroupMemberList

func (d *DataBase) GetAllGroupMemberList(ctx context.Context) ([]model_struct.LocalGroupMember, error)

func (*DataBase) GetAllGroupMemberUserIDList

func (d *DataBase) GetAllGroupMemberUserIDList(ctx context.Context) ([]model_struct.LocalGroupMember, error)

func (*DataBase) GetAllMessageForTest

func (d *DataBase) GetAllMessageForTest(ctx context.Context) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) GetAllSendingMessages

func (d *DataBase) GetAllSendingMessages(ctx context.Context) (friendRequests []*model_struct.LocalSendingMessages, err error)

func (*DataBase) GetAllSingleConversationIDList

func (d *DataBase) GetAllSingleConversationIDList(ctx context.Context) (result []string, err error)

func (*DataBase) GetAllUnDeleteMessageSeqList

func (d *DataBase) GetAllUnDeleteMessageSeqList(ctx context.Context) ([]uint32, error)

func (*DataBase) GetAlreadyExistSeqList

func (d *DataBase) GetAlreadyExistSeqList(ctx context.Context, conversationID string, lostSeqList []int64) (seqList []int64, err error)

func (*DataBase) GetBlackInfoByBlockUserID

func (d *DataBase) GetBlackInfoByBlockUserID(ctx context.Context, blockUserID string) (*model_struct.LocalBlack, error)

func (*DataBase) GetBlackInfoList

func (d *DataBase) GetBlackInfoList(ctx context.Context, blockUserIDList []string) ([]*model_struct.LocalBlack, error)

func (*DataBase) GetBlackListDB

func (d *DataBase) GetBlackListDB(ctx context.Context) ([]*model_struct.LocalBlack, error)

func (*DataBase) GetBlackListUserID

func (d *DataBase) GetBlackListUserID(ctx context.Context) (blackListUid []string, err error)

func (*DataBase) GetBothFriendReq

func (d *DataBase) GetBothFriendReq(ctx context.Context, fromUserID, toUserID string) (friendRequests []*model_struct.LocalFriendRequest, err error)

func (*DataBase) GetConversation

func (d *DataBase) GetConversation(ctx context.Context, conversationID string) (*model_struct.LocalConversation, error)

func (*DataBase) GetConversationAbnormalMsgSeq

func (d *DataBase) GetConversationAbnormalMsgSeq(ctx context.Context, conversationID string) (int64, error)

func (*DataBase) GetConversationByUserID

func (d *DataBase) GetConversationByUserID(ctx context.Context, userID string) (*model_struct.LocalConversation, error)

func (*DataBase) GetConversationListSplitDB

func (d *DataBase) GetConversationListSplitDB(ctx context.Context, offset, count int) ([]*model_struct.LocalConversation, error)

func (*DataBase) GetConversationNormalMsgSeq

func (d *DataBase) GetConversationNormalMsgSeq(ctx context.Context, conversationID string) (int64, error)

func (*DataBase) GetConversationPeerNormalMsgSeq

func (d *DataBase) GetConversationPeerNormalMsgSeq(ctx context.Context, conversationID string) (int64, error)

func (*DataBase) GetFriendApplicationByBothID

func (d *DataBase) GetFriendApplicationByBothID(ctx context.Context, fromUserID, toUserID string) (*model_struct.LocalFriendRequest, error)

func (*DataBase) GetFriendInfoByFriendUserID

func (d *DataBase) GetFriendInfoByFriendUserID(ctx context.Context, FriendUserID string) (*model_struct.LocalFriend, error)

func (*DataBase) GetFriendInfoList

func (d *DataBase) GetFriendInfoList(ctx context.Context, friendUserIDList []string) ([]*model_struct.LocalFriend, error)

func (*DataBase) GetGroupAdminID

func (d *DataBase) GetGroupAdminID(ctx context.Context, groupID string) ([]string, error)

func (*DataBase) GetGroupInfoByGroupID

func (d *DataBase) GetGroupInfoByGroupID(ctx context.Context, groupID string) (*model_struct.LocalGroup, error)

func (*DataBase) GetGroupMemberAllGroupIDs

func (d *DataBase) GetGroupMemberAllGroupIDs(ctx context.Context) ([]string, error)

func (*DataBase) GetGroupMemberCount

func (d *DataBase) GetGroupMemberCount(ctx context.Context, groupID string) (int32, error)

func (*DataBase) GetGroupMemberInfoByGroupIDUserID

func (d *DataBase) GetGroupMemberInfoByGroupIDUserID(ctx context.Context, groupID, userID string) (*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberInfoIfOwnerOrAdmin

func (d *DataBase) GetGroupMemberInfoIfOwnerOrAdmin(ctx context.Context) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberListByGroupID

func (d *DataBase) GetGroupMemberListByGroupID(ctx context.Context, groupID string) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberListSplit

func (d *DataBase) GetGroupMemberListSplit(ctx context.Context, groupID string, filter int32, offset, count int) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberListSplitByJoinTimeFilter

func (d *DataBase) GetGroupMemberListSplitByJoinTimeFilter(ctx context.Context, groupID string, offset, count int, joinTimeBegin, joinTimeEnd int64, userIDList []string) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberOwner

func (d *DataBase) GetGroupMemberOwner(ctx context.Context, groupID string) (*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberOwnerAndAdminDB

func (d *DataBase) GetGroupMemberOwnerAndAdminDB(ctx context.Context, groupID string) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupMemberUIDListByGroupID

func (d *DataBase) GetGroupMemberUIDListByGroupID(ctx context.Context, groupID string) (result []string, err error)

func (*DataBase) GetGroupMinSeq

func (d *DataBase) GetGroupMinSeq(ctx context.Context, groupID string) (uint32, error)

func (*DataBase) GetGroupOwnerAndAdminByGroupID

func (d *DataBase) GetGroupOwnerAndAdminByGroupID(ctx context.Context, groupID string) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroupSomeMemberInfo

func (d *DataBase) GetGroupSomeMemberInfo(ctx context.Context, groupID string, userIDList []string) ([]*model_struct.LocalGroupMember, error)

func (*DataBase) GetGroups

func (d *DataBase) GetGroups(ctx context.Context, groupIDs []string) ([]*model_struct.LocalGroup, error)

func (*DataBase) GetHiddenConversationList

func (d *DataBase) GetHiddenConversationList(ctx context.Context) ([]*model_struct.LocalConversation, error)

func (*DataBase) GetJoinedGroupListDB

func (d *DataBase) GetJoinedGroupListDB(ctx context.Context) ([]*model_struct.LocalGroup, error)

func (*DataBase) GetJoinedWorkingGroupIDList

func (d *DataBase) GetJoinedWorkingGroupIDList(ctx context.Context) ([]string, error)

func (*DataBase) GetJoinedWorkingGroupList

func (d *DataBase) GetJoinedWorkingGroupList(ctx context.Context) ([]*model_struct.LocalGroup, error)

func (*DataBase) GetLoginUser

func (d *DataBase) GetLoginUser(ctx context.Context, userID string) (*model_struct.LocalUser, error)

func (*DataBase) GetMessage

func (d *DataBase) GetMessage(ctx context.Context, conversationID string, clientMsgID string) (*model_struct.LocalChatLog, error)

func (*DataBase) GetMessageBySeq

func (d *DataBase) GetMessageBySeq(ctx context.Context, conversationID string, seq int64) (*model_struct.LocalChatLog, error)

func (*DataBase) GetMessageList

func (d *DataBase) GetMessageList(ctx context.Context, conversationID string, count int, startTime int64, isReverse bool) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) GetMessageListNoTime

func (d *DataBase) GetMessageListNoTime(ctx context.Context, conversationID string,
	count int, isReverse bool) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) GetMessageReactionExtension

func (d *DataBase) GetMessageReactionExtension(ctx context.Context, msgID string) (result *model_struct.LocalChatLogReactionExtensions, err error)

func (*DataBase) GetMessagesByClientMsgIDs

func (d *DataBase) GetMessagesByClientMsgIDs(ctx context.Context, conversationID string, msgIDs []string) (msgs []*model_struct.LocalChatLog, err error)

func (*DataBase) GetMessagesBySeqs

func (d *DataBase) GetMessagesBySeqs(ctx context.Context, conversationID string, seqs []int64) (msgs []*model_struct.LocalChatLog, err error)

func (*DataBase) GetMinSeq

func (d *DataBase) GetMinSeq(ctx context.Context, ID string) (uint32, error)

func (*DataBase) GetMsgSeqByClientMsgID

func (d *DataBase) GetMsgSeqByClientMsgID(ctx context.Context, clientMsgID string) (uint32, error)

func (*DataBase) GetMsgSeqByClientMsgIDController

func (d *DataBase) GetMsgSeqByClientMsgIDController(ctx context.Context, m *sdk_struct.MsgStruct) (uint32, error)

func (*DataBase) GetMsgSeqListByGroupID

func (d *DataBase) GetMsgSeqListByGroupID(ctx context.Context, groupID string) ([]uint32, error)

func (*DataBase) GetMsgSeqListByPeerUserID

func (d *DataBase) GetMsgSeqListByPeerUserID(ctx context.Context, userID string) ([]uint32, error)

func (*DataBase) GetMsgSeqListBySelfUserID

func (d *DataBase) GetMsgSeqListBySelfUserID(ctx context.Context, userID string) ([]uint32, error)

func (*DataBase) GetMultipleConversationDB

func (d *DataBase) GetMultipleConversationDB(ctx context.Context, conversationIDList []string) (result []*model_struct.LocalConversation, err error)

func (*DataBase) GetMultipleMessageReactionExtension

func (d *DataBase) GetMultipleMessageReactionExtension(ctx context.Context, msgIDList []string) (result []*model_struct.LocalChatLogReactionExtensions, err error)

func (*DataBase) GetNotificationAllSeqs

func (d *DataBase) GetNotificationAllSeqs(ctx context.Context) ([]*model_struct.NotificationSeqs, error)

func (*DataBase) GetPageFriendList

func (d *DataBase) GetPageFriendList(ctx context.Context, offset, count int) ([]*model_struct.LocalFriend, error)

func (*DataBase) GetRecvFriendApplication

func (d *DataBase) GetRecvFriendApplication(ctx context.Context) ([]*model_struct.LocalFriendRequest, error)

func (*DataBase) GetSendFriendApplication

func (d *DataBase) GetSendFriendApplication(ctx context.Context) ([]*model_struct.LocalFriendRequest, error)

func (*DataBase) GetSendGroupApplication

func (d *DataBase) GetSendGroupApplication(ctx context.Context) ([]*model_struct.LocalGroupRequest, error)

func (*DataBase) GetStrangerInfo

func (d *DataBase) GetStrangerInfo(ctx context.Context, userIDs []string) ([]*model_struct.LocalStranger, error)

func (*DataBase) GetSuperGroupInfoByGroupID

func (d *DataBase) GetSuperGroupInfoByGroupID(ctx context.Context, groupID string) (*model_struct.LocalGroup, error)

func (*DataBase) GetTestMessage

func (d *DataBase) GetTestMessage(ctx context.Context, seq uint32) (*model_struct.LocalChatLog, error)

func (*DataBase) GetTotalUnreadMsgCountDB

func (d *DataBase) GetTotalUnreadMsgCountDB(ctx context.Context) (totalUnreadCount int32, err error)

func (*DataBase) GetUnreadMessage

func (d *DataBase) GetUnreadMessage(ctx context.Context, conversationID string) (msgs []*model_struct.LocalChatLog, err error)

func (*DataBase) GetUpload

func (d *DataBase) GetUpload(ctx context.Context, partHash string) (*model_struct.LocalUpload, error)

func (*DataBase) GetUserJoinedGroupIDs

func (d *DataBase) GetUserJoinedGroupIDs(ctx context.Context, userID string) (groupIDs []string, err error)

func (*DataBase) GetUserMinSeq

func (d *DataBase) GetUserMinSeq(ctx context.Context) (uint32, error)

func (*DataBase) GetWorkMomentsNotification

func (d *DataBase) GetWorkMomentsNotification(ctx context.Context, offset, count int) (WorkMomentsNotifications []*model_struct.LocalWorkMomentsNotification, err error)

func (*DataBase) GetWorkMomentsNotificationLimit

func (d *DataBase) GetWorkMomentsNotificationLimit(ctx context.Context, pageNumber, showNumber int) (WorkMomentsNotifications []*model_struct.LocalWorkMomentsNotification, err error)

func (*DataBase) GetWorkMomentsUnReadCount

func (d *DataBase) GetWorkMomentsUnReadCount(ctx context.Context) (workMomentsNotificationUnReadCount model_struct.LocalWorkMomentsNotificationUnreadCount, err error)

func (*DataBase) IncrConversationUnreadCount

func (d *DataBase) IncrConversationUnreadCount(ctx context.Context, conversationID string) error

func (*DataBase) IncrWorkMomentsNotificationUnreadCount

func (d *DataBase) IncrWorkMomentsNotificationUnreadCount(ctx context.Context) error

func (*DataBase) InitDB

func (d *DataBase) InitDB(ctx context.Context, userID string, dataDir string) error

func (*DataBase) InitSuperLocalChatLog

func (d *DataBase) InitSuperLocalChatLog(ctx context.Context, groupID string)

func (*DataBase) InitSuperLocalErrChatLog

func (d *DataBase) InitSuperLocalErrChatLog(ctx context.Context, groupID string)

func (*DataBase) InitWorkMomentsNotificationUnreadCount

func (d *DataBase) InitWorkMomentsNotificationUnreadCount(ctx context.Context) error

func (*DataBase) InsertAdminGroupRequest

func (d *DataBase) InsertAdminGroupRequest(ctx context.Context, groupRequest *model_struct.LocalAdminGroupRequest) error

func (*DataBase) InsertBlack

func (d *DataBase) InsertBlack(ctx context.Context, black *model_struct.LocalBlack) error

func (*DataBase) InsertConversation

func (d *DataBase) InsertConversation(ctx context.Context, conversationList *model_struct.LocalConversation) error

func (*DataBase) InsertFriend

func (d *DataBase) InsertFriend(ctx context.Context, friend *model_struct.LocalFriend) error

func (*DataBase) InsertFriendRequest

func (d *DataBase) InsertFriendRequest(ctx context.Context, friendRequest *model_struct.LocalFriendRequest) error

func (*DataBase) InsertGroup

func (d *DataBase) InsertGroup(ctx context.Context, groupInfo *model_struct.LocalGroup) error

func (*DataBase) InsertGroupMember

func (d *DataBase) InsertGroupMember(ctx context.Context, groupMember *model_struct.LocalGroupMember) error

func (*DataBase) InsertGroupRequest

func (d *DataBase) InsertGroupRequest(ctx context.Context, groupRequest *model_struct.LocalGroupRequest) error

func (*DataBase) InsertLoginUser

func (d *DataBase) InsertLoginUser(ctx context.Context, user *model_struct.LocalUser) error

func (*DataBase) InsertMessage

func (d *DataBase) InsertMessage(ctx context.Context, conversationID string, Message *model_struct.LocalChatLog) error

func (*DataBase) InsertMessageReactionExtension

func (d *DataBase) InsertMessageReactionExtension(ctx context.Context, messageReactionExtension *model_struct.LocalChatLogReactionExtensions) error

func (*DataBase) InsertSendingMessage

func (d *DataBase) InsertSendingMessage(ctx context.Context, message *model_struct.LocalSendingMessages) error

func (*DataBase) InsertSuperGroup

func (d *DataBase) InsertSuperGroup(ctx context.Context, groupInfo *model_struct.LocalGroup) error

func (*DataBase) InsertTempCacheMessage

func (d *DataBase) InsertTempCacheMessage(ctx context.Context, Message *model_struct.TempCacheLocalChatLog) error

func (*DataBase) InsertUpload

func (d *DataBase) InsertUpload(ctx context.Context, upload *model_struct.LocalUpload) error

func (*DataBase) InsertWorkMomentsNotification

func (d *DataBase) InsertWorkMomentsNotification(ctx context.Context, jsonDetail string) error

func (*DataBase) IsExistsInErrChatLogBySeq

func (d *DataBase) IsExistsInErrChatLogBySeq(ctx context.Context, seq int64) bool

func (*DataBase) MarkAllWorkMomentsNotificationAsRead

func (d *DataBase) MarkAllWorkMomentsNotificationAsRead(ctx context.Context) (err error)

func (*DataBase) MarkConversationAllMessageAsRead

func (d *DataBase) MarkConversationAllMessageAsRead(ctx context.Context, conversationID string) (rowsAffected int64, err error)

func (*DataBase) MarkConversationMessageAsReadBySeqs

func (d *DataBase) MarkConversationMessageAsReadBySeqs(ctx context.Context, conversationID string, seqs []int64) (rowsAffected int64, err error)

func (*DataBase) MarkConversationMessageAsReadDB

func (d *DataBase) MarkConversationMessageAsReadDB(ctx context.Context, conversationID string, msgIDs []string) (rowsAffected int64, err error)

func (*DataBase) MarkDeleteConversationAllMessages

func (d *DataBase) MarkDeleteConversationAllMessages(ctx context.Context, conversationID string) error

func (*DataBase) MessageIfExists

func (d *DataBase) MessageIfExists(ctx context.Context, ClientMsgID string) (bool, error)

func (*DataBase) MessageIfExistsBySeq

func (d *DataBase) MessageIfExistsBySeq(ctx context.Context, seq int64) (bool, error)

func (*DataBase) RemoveConversationDraft

func (d *DataBase) RemoveConversationDraft(ctx context.Context, conversationID, draftText string) error

func (*DataBase) ResetAllConversation

func (d *DataBase) ResetAllConversation(ctx context.Context) error

ResetAllConversation Reset ALL conversation is equivalent to deleting the conversation, and the GetAllConversation or GetConversationListSplit interface will no longer be obtained.

func (*DataBase) ResetConversation

func (d *DataBase) ResetConversation(ctx context.Context, conversationID string) error

Reset the conversation is equivalent to deleting the conversation, and the GetAllConversation or GetConversationListSplit interface will no longer be obtained.

func (*DataBase) SearchAllMessageByContentType

func (d *DataBase) SearchAllMessageByContentType(ctx context.Context, conversationID string, contentType int) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SearchConversations

func (d *DataBase) SearchConversations(ctx context.Context, searchParam string) ([]*model_struct.LocalConversation, error)

func (*DataBase) SearchFriendList

func (d *DataBase) SearchFriendList(ctx context.Context, keyword string, isSearchUserID, isSearchNickname, isSearchRemark bool) ([]*model_struct.LocalFriend, error)

func (*DataBase) SearchGroupMembersDB

func (d *DataBase) SearchGroupMembersDB(ctx context.Context, keyword string, groupID string, isSearchMemberNickname, isSearchUserID bool, offset, count int) (result []*model_struct.LocalGroupMember, err error)

func (*DataBase) SearchMessageByContentType

func (d *DataBase) SearchMessageByContentType(ctx context.Context, contentType []int, conversationID string, startTime, endTime int64, offset, count int) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SearchMessageByContentTypeAndKeyword

func (d *DataBase) SearchMessageByContentTypeAndKeyword(ctx context.Context, contentType []int, conversationID string, keywordList []string, keywordListMatchType int, startTime, endTime int64) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SearchMessageByKeyword

func (d *DataBase) SearchMessageByKeyword(ctx context.Context, contentType []int, keywordList []string, keywordListMatchType int, conversationID string, startTime, endTime int64, offset, count int) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SetChatLogFailedStatus

func (d *DataBase) SetChatLogFailedStatus(ctx context.Context)

func (*DataBase) SetConversationDraftDB

func (d *DataBase) SetConversationDraftDB(ctx context.Context, conversationID, draftText string) error

func (*DataBase) SetMinSeq

func (d *DataBase) SetMinSeq(ctx context.Context, ID string, minSeq uint32) error

func (*DataBase) SetMultipleConversationRecvMsgOpt

func (d *DataBase) SetMultipleConversationRecvMsgOpt(ctx context.Context, conversationIDList []string, opt int) (err error)

func (*DataBase) SetNotificationSeq

func (d *DataBase) SetNotificationSeq(ctx context.Context, conversationID string, seq int64) error

func (*DataBase) SetStrangerInfo

func (d *DataBase) SetStrangerInfo(ctx context.Context, localStrangerList []*model_struct.LocalStranger) error

func (*DataBase) SubtractMemberCount

func (d *DataBase) SubtractMemberCount(ctx context.Context, groupID string) error

func (*DataBase) SuperBatchInsertExceptionMsg

func (d *DataBase) SuperBatchInsertExceptionMsg(ctx context.Context, MessageList []*model_struct.LocalErrChatLog, groupID string) error

func (*DataBase) SuperGroupBatchInsertMessageList

func (d *DataBase) SuperGroupBatchInsertMessageList(ctx context.Context, MessageList []*model_struct.LocalChatLog, groupID string) error

func (*DataBase) SuperGroupBatchUpdateMessageList

func (d *DataBase) SuperGroupBatchUpdateMessageList(ctx context.Context, MessageList []*model_struct.LocalChatLog) error

func (*DataBase) SuperGroupDeleteAllMessage

func (d *DataBase) SuperGroupDeleteAllMessage(ctx context.Context, groupID string) error

func (*DataBase) SuperGroupGetAllUnDeleteMessageSeqList

func (d *DataBase) SuperGroupGetAllUnDeleteMessageSeqList(ctx context.Context) ([]uint32, error)

func (*DataBase) SuperGroupGetMessage

func (d *DataBase) SuperGroupGetMessage(ctx context.Context, msg *sdk_struct.MsgStruct) (*model_struct.LocalChatLog, error)

func (*DataBase) SuperGroupGetMessageList

func (d *DataBase) SuperGroupGetMessageList(ctx context.Context, sourceID string, sessionType, count int, startTime int64, isReverse bool) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupGetMessageListNoTime

func (d *DataBase) SuperGroupGetMessageListNoTime(ctx context.Context, sourceID string, sessionType, count int, isReverse bool) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupGetMsgSeqByClientMsgID

func (d *DataBase) SuperGroupGetMsgSeqByClientMsgID(ctx context.Context, clientMsgID string, groupID string) (uint32, error)

func (*DataBase) SuperGroupGetMsgSeqListByGroupID

func (d *DataBase) SuperGroupGetMsgSeqListByGroupID(ctx context.Context, groupID string) ([]uint32, error)

func (*DataBase) SuperGroupGetMsgSeqListByPeerUserID

func (d *DataBase) SuperGroupGetMsgSeqListByPeerUserID(ctx context.Context, userID string) ([]uint32, error)

func (*DataBase) SuperGroupGetMsgSeqListBySelfUserID

func (d *DataBase) SuperGroupGetMsgSeqListBySelfUserID(ctx context.Context, userID string) ([]uint32, error)

func (*DataBase) SuperGroupGetNormalMinSeq

func (d *DataBase) SuperGroupGetNormalMinSeq(ctx context.Context, groupID string) (int64, error)

func (*DataBase) SuperGroupGetNormalMsgSeq

func (d *DataBase) SuperGroupGetNormalMsgSeq(ctx context.Context) (int64, error)

func (*DataBase) SuperGroupGetSendingMessageList

func (d *DataBase) SuperGroupGetSendingMessageList(ctx context.Context, groupID string) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupGetTestMessage

func (d *DataBase) SuperGroupGetTestMessage(ctx context.Context, seq int64) (*model_struct.LocalChatLog, error)

func (*DataBase) SuperGroupInsertMessage

func (d *DataBase) SuperGroupInsertMessage(ctx context.Context, Message *model_struct.LocalChatLog, groupID string) error

func (*DataBase) SuperGroupIsExistsInErrChatLogBySeq

func (d *DataBase) SuperGroupIsExistsInErrChatLogBySeq(ctx context.Context, seq int64) bool

func (*DataBase) SuperGroupMessageIfExists

func (d *DataBase) SuperGroupMessageIfExists(ctx context.Context, ClientMsgID string) (bool, error)

func (*DataBase) SuperGroupMessageIfExistsBySeq

func (d *DataBase) SuperGroupMessageIfExistsBySeq(ctx context.Context, seq int64) (bool, error)

func (*DataBase) SuperGroupSearchAllMessageByContentType

func (d *DataBase) SuperGroupSearchAllMessageByContentType(ctx context.Context, groupID string, contentType int32) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupSearchMessageByContentType

func (d *DataBase) SuperGroupSearchMessageByContentType(ctx context.Context, contentType []int, sourceID string, startTime, endTime int64, sessionType, offset, count int) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupSearchMessageByContentTypeAndKeyword

func (d *DataBase) SuperGroupSearchMessageByContentTypeAndKeyword(ctx context.Context, contentType []int, keywordList []string, keywordListMatchType int, startTime, endTime int64, groupID string) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupSearchMessageByKeyword

func (d *DataBase) SuperGroupSearchMessageByKeyword(ctx context.Context, contentType []int, keywordList []string, keywordListMatchType int, sourceID string, startTime, endTime int64, sessionType, offset, count int) (result []*model_struct.LocalChatLog, err error)

func (*DataBase) SuperGroupUpdateColumnsMessage

func (d *DataBase) SuperGroupUpdateColumnsMessage(ctx context.Context, ClientMsgID, groupID string, args map[string]interface{}) error

func (*DataBase) SuperGroupUpdateGroupMessageFields

func (d *DataBase) SuperGroupUpdateGroupMessageFields(ctx context.Context, msgIDList []string, groupID string, args map[string]interface{}) error

func (*DataBase) SuperGroupUpdateGroupMessageHasRead

func (d *DataBase) SuperGroupUpdateGroupMessageHasRead(ctx context.Context, msgIDList []string, groupID string) error

func (*DataBase) SuperGroupUpdateMessage

func (d *DataBase) SuperGroupUpdateMessage(ctx context.Context, c *model_struct.LocalChatLog) error

func (*DataBase) SuperGroupUpdateMessageStatusBySourceID

func (d *DataBase) SuperGroupUpdateMessageStatusBySourceID(ctx context.Context, sourceID string, status, sessionType int32) error

func (*DataBase) SuperGroupUpdateMessageTimeAndStatus

func (d *DataBase) SuperGroupUpdateMessageTimeAndStatus(ctx context.Context, msg *sdk_struct.MsgStruct) error

func (*DataBase) SuperGroupUpdateMsgSenderFaceURL

func (d *DataBase) SuperGroupUpdateMsgSenderFaceURL(ctx context.Context, sendID, faceURL string, sType int) error

func (*DataBase) SuperGroupUpdateMsgSenderFaceURLAndSenderNickname

func (d *DataBase) SuperGroupUpdateMsgSenderFaceURLAndSenderNickname(ctx context.Context, sendID, faceURL, nickname string, sessionType int, groupID string) error

func (*DataBase) SuperGroupUpdateMsgSenderNickname

func (d *DataBase) SuperGroupUpdateMsgSenderNickname(ctx context.Context, sendID, nickname string, sType int) error

func (*DataBase) SuperGroupUpdateSpecificContentTypeMessage

func (d *DataBase) SuperGroupUpdateSpecificContentTypeMessage(ctx context.Context, contentType int, groupID string, args map[string]interface{}) error

func (*DataBase) UnPinConversation

func (d *DataBase) UnPinConversation(ctx context.Context, conversationID string, isPinned int) error

func (*DataBase) UpdateAdminGroupRequest

func (d *DataBase) UpdateAdminGroupRequest(ctx context.Context, groupRequest *model_struct.LocalAdminGroupRequest) error

func (*DataBase) UpdateAllConversation

func (d *DataBase) UpdateAllConversation(ctx context.Context, conversation *model_struct.LocalConversation) error

func (*DataBase) UpdateBlack

func (d *DataBase) UpdateBlack(ctx context.Context, black *model_struct.LocalBlack) error

func (*DataBase) UpdateColumnsConversation

func (d *DataBase) UpdateColumnsConversation(ctx context.Context, conversationID string, args map[string]interface{}) error

func (*DataBase) UpdateColumnsFriend

func (d *DataBase) UpdateColumnsFriend(ctx context.Context, friendIDs []string, args map[string]interface{}) error

func (*DataBase) UpdateColumnsMessage

func (d *DataBase) UpdateColumnsMessage(ctx context.Context, conversationID, ClientMsgID string, args map[string]interface{}) error

func (*DataBase) UpdateColumnsMessageList

func (d *DataBase) UpdateColumnsMessageList(ctx context.Context, clientMsgIDList []string, args map[string]interface{}) error

func (*DataBase) UpdateConversation

func (d *DataBase) UpdateConversation(ctx context.Context, c *model_struct.LocalConversation) error

func (*DataBase) UpdateConversationForSync

func (d *DataBase) UpdateConversationForSync(ctx context.Context, c *model_struct.LocalConversation) error

func (*DataBase) UpdateFriend

func (d *DataBase) UpdateFriend(ctx context.Context, friend *model_struct.LocalFriend) error

func (*DataBase) UpdateFriendRequest

func (d *DataBase) UpdateFriendRequest(ctx context.Context, friendRequest *model_struct.LocalFriendRequest) error

func (*DataBase) UpdateGroup

func (d *DataBase) UpdateGroup(ctx context.Context, groupInfo *model_struct.LocalGroup) error

func (*DataBase) UpdateGroupMember

func (d *DataBase) UpdateGroupMember(ctx context.Context, groupMember *model_struct.LocalGroupMember) error

func (*DataBase) UpdateGroupMemberField

func (d *DataBase) UpdateGroupMemberField(ctx context.Context, groupID, userID string, args map[string]interface{}) error

func (*DataBase) UpdateGroupRequest

func (d *DataBase) UpdateGroupRequest(ctx context.Context, groupRequest *model_struct.LocalGroupRequest) error

func (*DataBase) UpdateLoginUser

func (d *DataBase) UpdateLoginUser(ctx context.Context, user *model_struct.LocalUser) error

func (*DataBase) UpdateLoginUserByMap

func (d *DataBase) UpdateLoginUserByMap(ctx context.Context, user *model_struct.LocalUser, args map[string]interface{}) error

func (*DataBase) UpdateMessage

func (d *DataBase) UpdateMessage(ctx context.Context, conversationID string, c *model_struct.LocalChatLog) error

func (*DataBase) UpdateMessageBySeq

func (d *DataBase) UpdateMessageBySeq(ctx context.Context, conversationID string, c *model_struct.LocalChatLog) error

func (*DataBase) UpdateMessageReactionExtension

func (d *DataBase) UpdateMessageReactionExtension(ctx context.Context, c *model_struct.LocalChatLogReactionExtensions) error

func (*DataBase) UpdateMessageStatusBySourceID

func (d *DataBase) UpdateMessageStatusBySourceID(ctx context.Context, sourceID string, status, sessionType int32) error

func (*DataBase) UpdateMessageStatusBySourceIDController

func (d *DataBase) UpdateMessageStatusBySourceIDController(ctx context.Context, sourceID string, status, sessionType int32) error

func (*DataBase) UpdateMessageTimeAndStatus

func (d *DataBase) UpdateMessageTimeAndStatus(ctx context.Context, conversationID, clientMsgID string, serverMsgID string, sendTime int64, status int32) error

func (*DataBase) UpdateMsgSenderFaceURL

func (d *DataBase) UpdateMsgSenderFaceURL(ctx context.Context, sendID, faceURL string, sType int) error

func (*DataBase) UpdateMsgSenderFaceURLAndSenderNickname

func (d *DataBase) UpdateMsgSenderFaceURLAndSenderNickname(ctx context.Context, conversationID, sendID, faceURL, nickname string) error

func (*DataBase) UpdateMsgSenderNickname

func (d *DataBase) UpdateMsgSenderNickname(ctx context.Context, sendID, nickname string, sType int) error

func (*DataBase) UpdateOrCreateConversations

func (d *DataBase) UpdateOrCreateConversations(ctx context.Context, conversationList []*model_struct.LocalConversation) error

func (*DataBase) UpdateSuperGroup

func (d *DataBase) UpdateSuperGroup(ctx context.Context, groupInfo *model_struct.LocalGroup) error

func (*DataBase) UpdateUpload

func (d *DataBase) UpdateUpload(ctx context.Context, upload *model_struct.LocalUpload) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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