浏览代码

update

master
shenjiachi 4 天前
父节点
当前提交
56214cb2a8
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. +2
    -2
      app/hdl/hdl_im.go
  2. +1
    -2
      app/utils/rpc_client.go

+ 2
- 2
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,


+ 1
- 2
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)))
}

正在加载...
取消
保存