This commit is contained in:
withchao
2023-03-07 12:19:30 +08:00
parent 3fe9ee22fe
commit 4c5613084c
40 changed files with 315 additions and 297 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"OpenIM/pkg/common/constant"
"OpenIM/pkg/common/db/table/relation"
"OpenIM/pkg/common/db/tx"
"OpenIM/pkg/errs"
"OpenIM/pkg/utils"
"context"
"errors"
@@ -235,7 +236,7 @@ func (f *friendDatabase) FindFriendsWithError(ctx context.Context, ownerUserID s
return
}
if len(friends) != len(friendUserIDs) {
err = constant.ErrRecordNotFound.Wrap()
err = errs.ErrRecordNotFound.Wrap()
}
return
}
+3 -2
View File
@@ -3,6 +3,7 @@ package controller
import (
"OpenIM/pkg/common/constant"
"OpenIM/pkg/common/db/table/relation"
"OpenIM/pkg/errs"
"OpenIM/pkg/utils"
"context"
)
@@ -60,7 +61,7 @@ func (u *userDatabase) FindWithError(ctx context.Context, userIDs []string) (use
return
}
if len(users) != len(userIDs) {
err = constant.ErrRecordNotFound.Wrap()
err = errs.ErrRecordNotFound.Wrap()
}
return
}
@@ -114,7 +115,7 @@ func (u *userDatabase) GetAllUserID(ctx context.Context) (userIDs []string, err
if total == int64(len(userIDs)) {
return userIDs, nil
}
return nil, constant.ErrData.Wrap("The total number of results and expectations are different, but result is nil")
return nil, errs.ErrData.Wrap("The total number of results and expectations are different, but result is nil")
}
userIDs = append(userIDs, tmp...)
pageNumber++