Merge remote-tracking branch 'origin/errcode' into errcode

# Conflicts:
#	internal/msgtransfer/online_history_msg_handler.go
#	internal/msgtransfer/online_msg_to_mongo_handler.go
#	internal/push/init.go
#	pkg/common/db/cache/redis.go
#	pkg/common/db/controller/msg.go
This commit is contained in:
withchao
2023-02-23 18:42:56 +08:00
25 changed files with 328 additions and 203 deletions
+6 -9
View File
@@ -21,16 +21,13 @@ import (
type RPCServer struct {
rpcPort int
rpcRegisterName string
etcdSchema string
etcdAddr []string
push controller.PushInterface
pushInterface controller.PushInterface
pusher Pusher
}
func (r *RPCServer) Init(rpcPort int, cache cache.MsgCache) {
r.rpcPort = rpcPort
r.rpcRegisterName = config.Config.RpcRegisterName.OpenImPushName
r.etcdSchema = config.Config.Etcd.EtcdSchema
r.etcdAddr = config.Config.Etcd.EtcdAddr
}
func (r *RPCServer) run() {
@@ -84,13 +81,13 @@ func (r *RPCServer) run() {
func (r *RPCServer) PushMsg(ctx context.Context, pbData *pbPush.PushMsgReq) (resp *pbPush.PushMsgResp, err error) {
switch pbData.MsgData.SessionType {
case constant.SuperGroupChatType:
MsgToSuperGroupUser(pbData)
err = r.pusher.MsgToSuperGroupUser(ctx, pbData.SourceID, pbData.MsgData)
default:
MsgToUser(pbData)
err = r.pusher.MsgToUser(ctx, pbData.SourceID, pbData.MsgData)
}
return &pbPush.PushMsgResp{}, nil
return &pbPush.PushMsgResp{}, err
}
func (r *RPCServer) DelUserPushToken(ctx context.Context, req *pbPush.DelUserPushTokenReq) (resp *pbPush.DelUserPushTokenResp, err error) {
return &pbPush.DelUserPushTokenResp{}, r.push.DelFcmToken(ctx, req.UserID, int(req.PlatformID))
return &pbPush.DelUserPushTokenResp{}, r.pushInterface.DelFcmToken(ctx, req.UserID, int(req.PlatformID))
}