fix: reinstall app sync data split.

This commit is contained in:
Gordon
2024-06-28 11:41:27 +08:00
parent b162725bd6
commit f0bd767d81
15 changed files with 292 additions and 70 deletions

View File

@@ -173,6 +173,7 @@ type MessageModel interface {
DeleteConversationMsgs(ctx context.Context, conversationID string, msgIDs []string) error
// DeleteConversationMsgsBySeqs(ctx context.Context, conversationID string, seqs []int64) error
SetNotificationSeq(ctx context.Context, conversationID string, seq int64) error
BatchInsertNotificationSeq(ctx context.Context, notificationSeqs []*model_struct.NotificationSeqs) error
GetNotificationAllSeqs(ctx context.Context) ([]*model_struct.NotificationSeqs, error)
}

View File

@@ -21,6 +21,7 @@ import (
"context"
"github.com/openimsdk/openim-sdk-core/v3/pkg/db/model_struct"
"github.com/openimsdk/openim-sdk-core/v3/pkg/utils"
"github.com/openimsdk/tools/errs"
)
func (d *DataBase) SetNotificationSeq(ctx context.Context, conversationID string, seq int64) error {
@@ -36,6 +37,12 @@ func (d *DataBase) SetNotificationSeq(ctx context.Context, conversationID string
return nil
}
func (d *DataBase) BatchInsertNotificationSeq(ctx context.Context, notificationSeqs []*model_struct.NotificationSeqs) error {
d.mRWMutex.Lock()
defer d.mRWMutex.Unlock()
return errs.WrapMsg(d.conn.WithContext(ctx).Create(notificationSeqs).Error, "BatchInsertNotificationSeq failed")
}
func (d *DataBase) GetNotificationAllSeqs(ctx context.Context) ([]*model_struct.NotificationSeqs, error) {
d.mRWMutex.Lock()
defer d.mRWMutex.Unlock()