mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-23 13:29:20 +08:00
msg api
This commit is contained in:
parent
a2c097ff0e
commit
ca0ee35d46
@ -13,13 +13,13 @@ import (
|
||||
)
|
||||
|
||||
type paramsUserPullMsg struct {
|
||||
ReqIdentifier int `json:"reqIdentifier" binding:"required"`
|
||||
ReqIdentifier *int `json:"reqIdentifier" binding:"required"`
|
||||
SendID string `json:"sendID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
MsgIncr int `json:"msgIncr" binding:"required"`
|
||||
MsgIncr *int `json:"msgIncr" binding:"required"`
|
||||
Data struct {
|
||||
SeqBegin int64 `json:"seqBegin" binding:"required"`
|
||||
SeqEnd int64 `json:"seqEnd" binding:"required"`
|
||||
SeqBegin *int64 `json:"seqBegin" binding:"required"`
|
||||
SeqEnd *int64 `json:"seqEnd" binding:"required"`
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,8 +39,8 @@ func UserPullMsg(c *gin.Context) {
|
||||
pbData := pbChat.PullMessageReq{}
|
||||
pbData.UserID = params.SendID
|
||||
pbData.OperationID = params.OperationID
|
||||
pbData.SeqBegin = params.Data.SeqBegin
|
||||
pbData.SeqEnd = params.Data.SeqEnd
|
||||
pbData.SeqBegin = *params.Data.SeqBegin
|
||||
pbData.SeqEnd = *params.Data.SeqEnd
|
||||
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
|
||||
msgClient := pbChat.NewChatClient(grpcConn)
|
||||
reply, err := msgClient.PullMessage(context.Background(), &pbData)
|
||||
@ -67,8 +67,8 @@ func UserPullMsg(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"errCode": reply.ErrCode,
|
||||
"errMsg": reply.ErrMsg,
|
||||
"msgIncr": params.MsgIncr,
|
||||
"reqIdentifier": params.ReqIdentifier,
|
||||
"msgIncr": *params.MsgIncr,
|
||||
"reqIdentifier": *params.ReqIdentifier,
|
||||
"data": msg,
|
||||
})
|
||||
|
||||
|
@ -18,17 +18,17 @@ type paramsUserSendMsg struct {
|
||||
PlatformID int32 `json:"platformID" binding:"required"`
|
||||
SendID string `json:"sendID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
MsgIncr int32 `json:"msgIncr" binding:"required"`
|
||||
MsgIncr int32 `json:"msgIncr"`
|
||||
Data struct {
|
||||
SessionType int32 `json:"sessionType" binding:"required"`
|
||||
MsgFrom int32 `json:"msgFrom" binding:"required"`
|
||||
ContentType int32 `json:"contentType" binding:"required"`
|
||||
RecvID string `json:"recvID" binding:"required"`
|
||||
ForceList []string `json:"forceList" binding:"required"`
|
||||
ForceList []string `json:"forceList"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
Options map[string]interface{} `json:"options" binding:"required"`
|
||||
Options map[string]interface{} `json:"options" `
|
||||
ClientMsgID string `json:"clientMsgID" binding:"required"`
|
||||
OffLineInfo map[string]interface{} `json:"offlineInfo" binding:"required"`
|
||||
OffLineInfo map[string]interface{} `json:"offlineInfo" `
|
||||
Ex map[string]interface{} `json:"ext"`
|
||||
}
|
||||
}
|
||||
@ -90,6 +90,7 @@ func UserSendMsg(c *gin.Context) {
|
||||
"data": gin.H{
|
||||
"clientMsgID": reply.ClientMsgID,
|
||||
"serverMsgID": reply.ServerMsgID,
|
||||
"sendTime": reply.SendTime,
|
||||
},
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user