Ver código fonte

update

master
shenjiachi 4 dias atrás
pai
commit
56214cb2a8
2 arquivos alterados com 3 adições e 4 exclusões
  1. +2
    -2
      app/hdl/hdl_im.go
  2. +1
    -2
      app/utils/rpc_client.go

+ 2
- 2
app/hdl/hdl_im.go Ver arquivo

@@ -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 Ver arquivo

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

Carregando…
Cancelar
Salvar