send message modify and ws add binary pt

pull/103/head
Gordon 3 years ago
parent 6ab6a49e15
commit 8ac9090171

@ -87,7 +87,7 @@ func UserSendMsg(c *gin.Context) {
"data": gin.H{
"clientMsgID": reply.ClientMsgID,
"serverMsgID": reply.ServerMsgID,
"sendTime": 0,
"sendTime": reply.SendTime,
},
})

@ -125,7 +125,7 @@ func ManagementSendMsg(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"errCode": reply.ErrCode,
"errMsg": reply.ErrMsg,
"sendTime": "",
"sendTime": reply.SendTime,
"msgID": reply.ClientMsgID,
})

@ -66,7 +66,11 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (*
pbData.MsgID = serverMsgID
pbData.OperationID = pb.OperationID
pbData.Token = pb.Token
pbData.SendTime = pb.SendTime
if pb.SendTime == 0 {
pbData.SendTime = utils.GetCurrentTimestampByNano()
} else {
pbData.SendTime = pb.SendTime
}
m := MsgCallBackResp{}
if config.Config.MessageCallBack.CallbackSwitch {
bMsg, err := http2.Post(config.Config.MessageCallBack.CallbackUrl, MsgCallBackReq{
@ -182,5 +186,6 @@ func returnMsg(replay *pbChat.UserSendMsgResp, pb *pbChat.UserSendMsgReq, errCod
replay.ReqIdentifier = pb.ReqIdentifier
replay.ClientMsgID = pb.ClientMsgID
replay.ServerMsgID = serverMsgID
replay.SendTime = sendTime
return replay, nil
}

Loading…
Cancel
Save