Browse Source

update

adv_callback
shenjiachi 1 month ago
parent
commit
56214cb2a8
2 changed files with 3 additions and 4 deletions
  1. +2
    -2
      app/hdl/hdl_im.go
  2. +1
    -2
      app/utils/rpc_client.go

+ 2
- 2
app/hdl/hdl_im.go View File

@@ -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 View File

@@ -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)))
}

Loading…
Cancel
Save