|
|
@ -467,6 +467,10 @@ func (m *MessageApi) SendSimpleMessage(c *gin.Context) {
|
|
|
|
sessionType int32
|
|
|
|
sessionType int32
|
|
|
|
recvID string
|
|
|
|
recvID string
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
if err = c.BindJSON(&req); err != nil {
|
|
|
|
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
err = json.Unmarshal(decodedData, &keyMsgData)
|
|
|
|
err = json.Unmarshal(decodedData, &keyMsgData)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
|
|
@ -490,6 +494,11 @@ func (m *MessageApi) SendSimpleMessage(c *gin.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
content, err := jsonutil.JsonMarshal(apistruct.MarkdownTextElem{Content: req.Content})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
apiresp.GinError(c, errs.Wrap(err))
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
msgData := &sdkws.MsgData{
|
|
|
|
msgData := &sdkws.MsgData{
|
|
|
|
SendID: sendID,
|
|
|
|
SendID: sendID,
|
|
|
|
RecvID: recvID,
|
|
|
|
RecvID: recvID,
|
|
|
@ -498,17 +507,17 @@ func (m *MessageApi) SendSimpleMessage(c *gin.Context) {
|
|
|
|
SenderPlatformID: constant.AdminPlatformID,
|
|
|
|
SenderPlatformID: constant.AdminPlatformID,
|
|
|
|
SessionType: sessionType,
|
|
|
|
SessionType: sessionType,
|
|
|
|
MsgFrom: constant.UserMsgType,
|
|
|
|
MsgFrom: constant.UserMsgType,
|
|
|
|
ContentType: constant.Text,
|
|
|
|
ContentType: constant.MarkdownText,
|
|
|
|
Content: []byte(req.Content),
|
|
|
|
Content: content,
|
|
|
|
OfflinePushInfo: req.OfflinePushInfo,
|
|
|
|
OfflinePushInfo: req.OfflinePushInfo,
|
|
|
|
Ex: req.Ex,
|
|
|
|
Ex: req.Ex,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sendReq := &msg.SendMsgReq{
|
|
|
|
sendReq := &msg.SendSimpleMsgReq{
|
|
|
|
MsgData: msgData,
|
|
|
|
MsgData: msgData,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
respPb, err := m.Client.SendMsg(c, sendReq)
|
|
|
|
respPb, err := m.Client.SendSimpleMsg(c, sendReq)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
apiresp.GinError(c, err)
|
|
|
|
apiresp.GinError(c, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -525,7 +534,12 @@ func (m *MessageApi) SendSimpleMessage(c *gin.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m.ginRespSendMsg(c, sendReq, respPb)
|
|
|
|
m.ginRespSendMsg(c, &msg.SendMsgReq{MsgData: sendReq.MsgData}, &msg.SendMsgResp{
|
|
|
|
|
|
|
|
ServerMsgID: respPb.ServerMsgID,
|
|
|
|
|
|
|
|
ClientMsgID: respPb.ClientMsgID,
|
|
|
|
|
|
|
|
SendTime: respPb.SendTime,
|
|
|
|
|
|
|
|
Modify: respPb.Modify,
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MessageApi) CheckMsgIsSendSuccess(c *gin.Context) {
|
|
|
|
func (m *MessageApi) CheckMsgIsSendSuccess(c *gin.Context) {
|
|
|
|