redis replace go redis

pull/236/head
Gordon 3 years ago
parent 5c979a532f
commit 4c305b7cc0

@ -7,10 +7,9 @@ import (
pbCommon "Open_IM/pkg/proto/sdk_ws" pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/golang/protobuf/proto" "github.com/mitchellh/mapstructure"
"strconv" "strconv"
"time" "time"
) )
@ -51,11 +50,7 @@ func (d *DataBases) NewGetMessageListBySeq(userID string, seqList []uint32, oper
} }
func Map2Pb(m map[string]string) (*pbCommon.MsgData, error) { func Map2Pb(m map[string]string) (*pbCommon.MsgData, error) {
var data pbCommon.MsgData var data pbCommon.MsgData
b, err := json.Marshal(m) err := mapstructure.Decode(m, &data)
if err != nil {
return nil, err
}
err = proto.Unmarshal(b, &data)
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save