mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-30 22:42:29 +08:00
Error code standardization
This commit is contained in:
parent
96ef753c77
commit
22f4d8f66d
@ -38,7 +38,7 @@ func (b *BlackController) Delete(ctx context.Context, blacks []*relation.BlackMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FindOwnerBlacks 获取黑名单列表
|
// 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)
|
return b.database.FindOwnerBlacks(ctx, ownerUserID, pageNumber, showNumber)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ type BlackDatabaseInterface interface {
|
|||||||
// Delete 删除黑名单
|
// Delete 删除黑名单
|
||||||
Delete(ctx context.Context, blacks []*relation.BlackModel) (err error)
|
Delete(ctx context.Context, blacks []*relation.BlackModel) (err error)
|
||||||
// FindOwnerBlacks 获取黑名单列表
|
// 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 检查user2是否在user1的黑名单列表中(inUser1Blacks==true) 检查user1是否在user2的黑名单列表中(inUser2Blacks==true)
|
||||||
CheckIn(ctx context.Context, userID1, userID2 string) (inUser1Blacks bool, inUser2Blacks bool, err error)
|
CheckIn(ctx context.Context, userID1, userID2 string) (inUser1Blacks bool, inUser2Blacks bool, err error)
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,8 @@ func (f *FriendController) PageFriendRequestToMe(ctx context.Context, userID str
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FindFriends 获取某人指定好友的信息
|
// FindFriends 获取某人指定好友的信息
|
||||||
func (f *FriendController) FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) {
|
func (f *FriendController) FindFriendsWithError(ctx context.Context, ownerUserID string, friendUserIDs []string) (friends []*relation.FriendModel, err error) {
|
||||||
return f.database.FindFriends(ctx, ownerUserID, friendUserIDs)
|
return f.database.FindFriendsWithError(ctx, ownerUserID, friendUserIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
type FriendDatabaseInterface interface {
|
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)
|
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 {
|
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)
|
friends, err = f.friend.FindFriends(ctx, ownerUserID, friendUserIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user