This commit is contained in:
Gordon 2021-10-25 20:12:50 +08:00
parent aecfea4d83
commit 219e97f3f6

View File

@ -50,7 +50,7 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) {
return return
} }
fmt.Println("test fmt Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID) fmt.Println("test fmt Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID)
log.InfoByKv("Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID) log.InfoByKv("Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID, "msgIncr", m.MsgIncr)
switch m.ReqIdentifier { switch m.ReqIdentifier {
case constant.WSGetNewestSeq: case constant.WSGetNewestSeq:
@ -106,8 +106,12 @@ func (ws *WServer) pullMsgResp(conn *UserConn, m *Req, pb *pbChat.PullMessageRes
var mReplyData pbWs.PullMessageBySeqListResp var mReplyData pbWs.PullMessageBySeqListResp
mReplyData.MaxSeq = pb.GetMaxSeq() mReplyData.MaxSeq = pb.GetMaxSeq()
mReplyData.MinSeq = pb.GetMinSeq() mReplyData.MinSeq = pb.GetMinSeq()
b, _ := json.Marshal(pb.GetSingleUserMsg) b, err := json.Marshal(pb.GetSingleUserMsg)
err := json.Unmarshal(b, &mReplyData.SingleUserMsg) if err != nil {
log.NewError(m.OperationID, "GetSingleUserMsg,json marshal,err", err.Error())
}
log.NewInfo(m.OperationID, "pullMsgResp json is ", string(b))
err = json.Unmarshal(b, &mReplyData.SingleUserMsg)
if err != nil { if err != nil {
log.NewError(m.OperationID, "SingleUserMsg,json Unmarshal,err", err.Error()) log.NewError(m.OperationID, "SingleUserMsg,json Unmarshal,err", err.Error())
} }
@ -222,7 +226,6 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) {
ClientMsgID: data.ClientMsgID, ClientMsgID: data.ClientMsgID,
SendTime: sendTime, SendTime: sendTime,
} }
log.InfoByKv("Ws call success to sendMsgReq", m.OperationID, "Parameters", m)
time := utils.GetCurrentTimestampBySecond() time := utils.GetCurrentTimestampBySecond()
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
client := pbChat.NewChatClient(etcdConn) client := pbChat.NewChatClient(etcdConn)