Browse Source

update

master
shenjiachi 1 day 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 接口 //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), ReceiverType: pb.ReceiverType(req.ReceiverType),
ReceiverId: req.ReceiverId, ReceiverId: req.ReceiverId,
MessageType: pb.MessageType_MT_RED_PACKAGE, 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) return pb.NewLogicExtClient(conn)
} }


func GetCtx(token, userId, deviceId, masterId string) context.Context {
func GetCtx(token, userId, deviceId string) context.Context {
if userId == "" { if userId == "" {
userId = "1" userId = "1"
} }
@@ -55,6 +55,5 @@ func GetCtx(token, userId, deviceId, masterId string) context.Context {
"user_id", userId, "user_id", userId,
"device_id", deviceId, "device_id", deviceId,
"token", token, "token", token,
"master_id", masterId,
"request_id", strconv.FormatInt(time.Now().UnixNano(), 10))) "request_id", strconv.FormatInt(time.Now().UnixNano(), 10)))
} }

Loading…
Cancel
Save