mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
conversation
This commit is contained in:
parent
b05bedf243
commit
934e531840
@ -168,10 +168,11 @@ func (c *ConversationDataBase) SetUserConversations(ctx context.Context, ownerUs
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(existConversations) > 0 {
|
if len(existConversations) > 0 {
|
||||||
log.ZDebug(ctx, "SetUserConversations", "existConversations", existConversations)
|
for _, conversation := range conversations {
|
||||||
err = conversationTx.Update(ctx, conversations)
|
err = conversationTx.Update(ctx, conversation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var existConversationIDs []string
|
var existConversationIDs []string
|
||||||
|
@ -33,8 +33,8 @@ func (c *ConversationGorm) UpdateByMap(ctx context.Context, userIDList []string,
|
|||||||
return utils.Wrap(c.db(ctx).Where("owner_user_id IN (?) and conversation_id=?", userIDList, conversationID).Updates(args).Error, "")
|
return utils.Wrap(c.db(ctx).Where("owner_user_id IN (?) and conversation_id=?", userIDList, conversationID).Updates(args).Error, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ConversationGorm) Update(ctx context.Context, conversations []*relation.ConversationModel) (err error) {
|
func (c *ConversationGorm) Update(ctx context.Context, conversation *relation.ConversationModel) (err error) {
|
||||||
return utils.Wrap(c.db(ctx).Updates(&conversations).Error, "")
|
return utils.Wrap(c.db(ctx).Updates(conversation).Error, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ConversationGorm) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*relation.ConversationModel, err error) {
|
func (c *ConversationGorm) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*relation.ConversationModel, err error) {
|
||||||
|
@ -33,7 +33,7 @@ type ConversationModelInterface interface {
|
|||||||
Create(ctx context.Context, conversations []*ConversationModel) (err error)
|
Create(ctx context.Context, conversations []*ConversationModel) (err error)
|
||||||
Delete(ctx context.Context, groupIDs []string) (err error)
|
Delete(ctx context.Context, groupIDs []string) (err error)
|
||||||
UpdateByMap(ctx context.Context, userIDs []string, conversationID string, args map[string]interface{}) (err error)
|
UpdateByMap(ctx context.Context, userIDs []string, conversationID string, args map[string]interface{}) (err error)
|
||||||
Update(ctx context.Context, conversations []*ConversationModel) (err error)
|
Update(ctx context.Context, conversation *ConversationModel) (err error)
|
||||||
Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*ConversationModel, err error)
|
Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*ConversationModel, err error)
|
||||||
FindUserID(ctx context.Context, userIDs []string, conversationID string) ([]string, error)
|
FindUserID(ctx context.Context, userIDs []string, conversationID string) ([]string, error)
|
||||||
FindUserIDAllConversationID(ctx context.Context, userID string) ([]string, error)
|
FindUserIDAllConversationID(ctx context.Context, userID string) ([]string, error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user