Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode

 Conflicts:
	internal/rpc/group/group.go
	pkg/common/db/controller/group.go
	pkg/common/db/relation/group_member_model_k.go
This commit is contained in:
wangchuxiao
2023-01-29 11:26:03 +08:00
3 changed files with 41 additions and 27 deletions
+12
View File
@@ -158,3 +158,15 @@ func (g *GroupDataBase) CreateSuperGroup(ctx context.Context, groupID string, in
func (g *GroupDataBase) GetSuperGroupByID(ctx context.Context, groupID string) (superGroup *unrelation.SuperGroup, err error) {
return g.mongoDB.GetSuperGroup(ctx, groupID)
}
func (g *GroupDataBase) CreateGroupAndMember(ctx context.Context, groups []*relation.Group, groupMember []*relation.GroupMember) error {
return g.db.Transaction(func(tx *gorm.DB) error {
if err := g.groupDB.Create(ctx, groups, tx); err != nil {
return err
}
if err := g.groupMemberDB.Create(ctx, groupMember, tx); err != nil {
return err
}
return nil
})
}