From 22f4d8f66d03ce9db2efc999be2dbce1cc41e768 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 9 Feb 2023 13:05:12 +0800 Subject: [PATCH] Error code standardization --- pkg/common/db/controller/black.go | 4 ++-- pkg/common/db/controller/friend.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/common/db/controller/black.go b/pkg/common/db/controller/black.go index 65bd259d6..6897b4974 100644 --- a/pkg/common/db/controller/black.go +++ b/pkg/common/db/controller/black.go @@ -38,7 +38,7 @@ func (b *BlackController) Delete(ctx context.Context, blacks []*relation.BlackMo } // FindOwnerBlacks 获取黑名单列表 -func (b *BlackController) FindOwnerBlacks(ctx context.Context, ownerUserID string, pageNumber, showNumber int32) (blackList []*relation.Black, total int64, err error) { +func (b *BlackController) FindOwnerBlacks(ctx context.Context, ownerUserID string, pageNumber, showNumber int32) (blackList []*relation.BlackModel, total int64, err error) { return b.database.FindOwnerBlacks(ctx, ownerUserID, pageNumber, showNumber) } @@ -53,7 +53,7 @@ type BlackDatabaseInterface interface { // Delete 删除黑名单 Delete(ctx context.Context, blacks []*relation.BlackModel) (err error) // FindOwnerBlacks 获取黑名单列表 - FindOwnerBlacks(ctx context.Context, ownerUserID string, pageNumber, showNumber int32) (blacks []*relation.Black, total int64, err error) + FindOwnerBlacks(ctx context.Context, ownerUserID string, pageNumber, showNumber int32) (blacks []*relation.BlackModel, total int64, err error) // CheckIn 检查user2是否在user1的黑名单列表中(inUser1Blacks==true) 检查user1是否在user2的黑名单列表中(inUser2Blacks==true) CheckIn(ctx context.Context, userID1, userID2 string) (inUser1Blacks bool, inUser2Blacks bool, err error) } diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go index 87308c4f8..ea322a9d3 100644 --- a/pkg/common/db/controller/friend.go +++ b/pkg/common/db/controller/friend.go @@ -101,8 +101,8 @@ func (f *FriendController) PageFriendRequestToMe(ctx context.Context, userID str } // FindFriends 获取某人指定好友的信息 -func (f *FriendController) FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) { - return f.database.FindFriends(ctx, ownerUserID, friendUserIDs) +func (f *FriendController) FindFriendsWithError(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) { + return f.database.FindFriendsWithError(ctx, ownerUserID, friendUserIDs) } type FriendDatabaseInterface interface { @@ -129,7 +129,7 @@ type FriendDatabaseInterface interface { // 获取我收到的的好友申请 PageFriendRequestToMe(ctx context.Context, userID string, pageNumber, showNumber int32) (friends []*relation.FriendRequestModel, total int64, err error) // 获取某人指定好友的信息 - FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) + FindFriendsWithError(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) } type FriendDatabase struct { @@ -322,7 +322,7 @@ func (f *FriendDatabase) PageFriendRequestToMe(ctx context.Context, userID strin } // 获取某人指定好友的信息 如果有好友不存在,也返回错误 -func (f *FriendDatabase) FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) { +func (f *FriendDatabase) FindFriendsWithError(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) { friends, err = f.friend.FindFriends(ctx, ownerUserID, friendUserIDs) if err != nil { return