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

# Conflicts:
#	pkg/common/db/mysql_model/im_mysql_model/group_model_k.go
This commit is contained in:
wangchuxiao 2023-01-04 19:49:47 +08:00
parent b9a11e4ca1
commit 633aefad56

View File

@ -50,14 +50,14 @@ func (*Group) Update(ctx context.Context, groups []*Group) (err error) {
} }
func (*Group) Find(ctx context.Context, groupIDList []string) (groupList []*Group, err error) { func (*Group) Find(ctx context.Context, groupIDList []string) (groupList []*Group, err error) {
defer trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "groupIDList", groupIDList) defer trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "groupIDList", groupIDList, "groupList", groupList)
err = utils.Wrap(db.DB.MysqlDB.DefaultGormDB().Where("group_id in (?)", groupIDList).Find(&groupList).Error, "") err = utils.Wrap(db.DB.MysqlDB.DefaultGormDB().Where("group_id in (?)", groupIDList).Find(&groupList).Error, "")
return groupList, err return groupList, err
} }
func (*Group) Take(ctx context.Context, groupID string) (group *Group, err error) { func (*Group) Take(ctx context.Context, groupID string) (group *Group, err error) {
defer trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "groupID", groupID)
group = &Group{} group = &Group{}
defer trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "groupID", groupID, "group", *group)
err = utils.Wrap(db.DB.MysqlDB.DefaultGormDB().Where("group_id = ?", groupID).Take(group).Error, "") err = utils.Wrap(db.DB.MysqlDB.DefaultGormDB().Where("group_id = ?", groupID).Take(group).Error, "")
return group, err return group, err
} }