mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-01 07:35:58 +08:00
Error code standardization
This commit is contained in:
@@ -11,4 +11,5 @@ func Access(ctx context.Context, ownerUserID string) (err error) {
|
||||
return err
|
||||
}
|
||||
return tokenverify.CheckAccessV3(ctx, ownerUserID)
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
discoveryRegistry "Open_IM/pkg/discoveryregistry"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type MsgCheck struct {
|
||||
zk discoveryRegistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (m *MsgCheck) getConn() (*grpc.ClientConn, error) {
|
||||
return m.zk.GetConn(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
}
|
||||
|
||||
func (m *MsgCheck) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error) {
|
||||
cc, err := m.getConn()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err := msg.NewMsgClient(cc).SendMsg(ctx, req)
|
||||
return resp, err
|
||||
}
|
||||
Reference in New Issue
Block a user