From 56214cb2a8a03cac20073682976495fbffab8f9b Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 26 Nov 2024 11:01:01 +0800 Subject: [PATCH] update --- app/hdl/hdl_im.go | 4 ++-- app/utils/rpc_client.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/hdl/hdl_im.go b/app/hdl/hdl_im.go index e98908c..3fa0722 100644 --- a/app/hdl/hdl_im.go +++ b/app/hdl/hdl_im.go @@ -104,8 +104,8 @@ func GrabRedPackage(c *gin.Context) { } //TODO::调用im GRPC 接口 - masterID := c.GetHeader("master_id") - res, err := utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).SendRedPacket(utils.GetCtx(req.Token, req.UserId, req.DeviceId, masterID), &pb.SendRedPacketReq{ + // masterID := c.GetHeader("master_id") + res, err := utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).SendRedPacket(utils.GetCtx(req.Token, req.UserId, req.DeviceId), &pb.SendRedPacketReq{ ReceiverType: pb.ReceiverType(req.ReceiverType), ReceiverId: req.ReceiverId, MessageType: pb.MessageType_MT_RED_PACKAGE, diff --git a/app/utils/rpc_client.go b/app/utils/rpc_client.go index 2f2d92d..c83b33c 100644 --- a/app/utils/rpc_client.go +++ b/app/utils/rpc_client.go @@ -41,7 +41,7 @@ func GetLogicExtClient(url, port string) pb.LogicExtClient { return pb.NewLogicExtClient(conn) } -func GetCtx(token, userId, deviceId, masterId string) context.Context { +func GetCtx(token, userId, deviceId string) context.Context { if userId == "" { userId = "1" } @@ -55,6 +55,5 @@ func GetCtx(token, userId, deviceId, masterId string) context.Context { "user_id", userId, "device_id", deviceId, "token", token, - "master_id", masterId, "request_id", strconv.FormatInt(time.Now().UnixNano(), 10))) }