Error code standardization

This commit is contained in:
skiffer-git
2023-01-31 10:03:10 +08:00
parent 6bce40535e
commit 467d44adc6
3 changed files with 15 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
package check
import (
"Open_IM/pkg/common/token_verify"
"context"
)
func Access(ctx context.Context, ownerUserID string) (err error) {
_, err = GetUsersInfo(ctx, ownerUserID)
if err != nil {
return err
}
return token_verify.CheckAccessV3(ctx, ownerUserID)
}
+1 -1
View File
@@ -162,7 +162,7 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri
if err := token_verify.CheckAdmin(ctx); err != nil {
return nil, err
}
if _, err := GetUsersInfo(ctx, req.OwnerUserID); err != nil {
if _, err := check.GetUsersInfo(ctx, req.OwnerUserID); err != nil {
return nil, err
}