mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 01:55:58 +08:00
Error code standardization
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
discoveryRegistry "Open_IM/pkg/discoveryregistry"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
"context"
|
||||
)
|
||||
|
||||
type ConversationChecker struct {
|
||||
zk discoveryRegistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (c *ConversationChecker) ModifyConversationField(ctx context.Context, req *pbConversation.ModifyConversationFieldReq) (resp *pbConversation.ModifyConversationFieldResp, err error) {
|
||||
return
|
||||
}
|
||||
@@ -106,5 +106,13 @@ func (g *GroupChecker) GetGroupMemberInfoMap(ctx context.Context, groupID string
|
||||
}
|
||||
|
||||
func (g *GroupChecker) GetOwnerAndAdminInfos(ctx context.Context, groupID string) ([]*sdkws.GroupMemberFullInfo, error) {
|
||||
|
||||
cc, err := g.getConn()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err := group.NewGroupClient(cc).GetGroupMemberRoleLevel(ctx, &group.GetGroupMemberRoleLevelReq{
|
||||
GroupID: groupID,
|
||||
RoleLevels: []int32{constant.GroupOwner, constant.GroupAdmin},
|
||||
})
|
||||
return resp.Members, err
|
||||
}
|
||||
|
||||
@@ -2,26 +2,22 @@ package notification
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func (c *Check) DeleteMessageNotification(ctx context.Context, userID string, seqList []uint32, operationID string) {
|
||||
DeleteMessageTips := sdkws.DeleteMessageTips{OpUserID: opUserID, UserID: userID, SeqList: seqList}
|
||||
c.MessageNotification(operationID, userID, userID, constant.DeleteMessageNotification, &DeleteMessageTips)
|
||||
DeleteMessageTips := sdkws.DeleteMessageTips{UserID: userID, SeqList: seqList}
|
||||
c.MessageNotification(ctx, userID, userID, constant.DeleteMessageNotification, &DeleteMessageTips)
|
||||
}
|
||||
|
||||
func (c *Check) MessageNotification(operationID, sendID, recvID string, contentType int32, m proto.Message) {
|
||||
log.Debug(operationID, utils.GetSelfFuncName(), "args: ", m.String(), contentType)
|
||||
func (c *Check) MessageNotification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message) {
|
||||
var err error
|
||||
var tips sdkws.TipsComm
|
||||
tips.Detail, err = proto.Marshal(m)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), m.String())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -40,8 +36,7 @@ func (c *Check) MessageNotification(operationID, sendID, recvID string, contentT
|
||||
n.MsgFrom = constant.SysMsgType
|
||||
n.Content, err = proto.Marshal(&tips)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
c.Notification(&n)
|
||||
c.Notification(ctx, &n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user