From c2375100800483f6ad7548de72f1d2006d9de24c Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 14 Feb 2023 12:10:15 +0800 Subject: [PATCH] Error code standardization --- internal/common/notification/c.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/common/notification/c.go b/internal/common/notification/c.go index 29894f806..52f6853b2 100644 --- a/internal/common/notification/c.go +++ b/internal/common/notification/c.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/tracelog" + discoveryRegistry "Open_IM/pkg/discoveryregistry" "Open_IM/pkg/proto/msg" "Open_IM/pkg/proto/sdkws" utils2 "Open_IM/pkg/utils" @@ -13,10 +14,21 @@ import ( ) type Check struct { - user *check.UserCheck - group *check.GroupChecker - msg *check.MsgCheck - friend *check.FriendChecker + user *check.UserCheck + group *check.GroupChecker + msg *check.MsgCheck + friend *check.FriendChecker + conversation *check.ConversationChecker +} + +func NewCheck(zk discoveryRegistry.SvcDiscoveryRegistry) *Check { + return &Check{ + user: check.NewUserCheck(zk), + group: check.NewGroupChecker(zk), + msg: check.NewMsgCheck(zk), + friend: check.NewFriendChecker(zk), + conversation: check.NewConversationChecker(zk), + } } type NotificationMsg struct {