Error code standardization

This commit is contained in:
skiffer-git
2023-02-14 11:33:10 +08:00
parent b7d724a5e4
commit 05d00a8174
7 changed files with 78 additions and 35 deletions
+1
View File
@@ -11,4 +11,5 @@ func Access(ctx context.Context, ownerUserID string) (err error) {
return err
}
return tokenverify.CheckAccessV3(ctx, ownerUserID)
}
+26
View File
@@ -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
}