mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fix the picture
This commit is contained in:
parent
c7a861f9a0
commit
96cf4f6bd1
@ -392,7 +392,7 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := &callbackstruct.CallbackAfterSendSingleMsgResp{
|
resp := callbackstruct.CallbackAfterSendSingleMsgResp{
|
||||||
CommonCallbackResp: callbackstruct.CommonCallbackResp{
|
CommonCallbackResp: callbackstruct.CommonCallbackResp{
|
||||||
ActionCode: 0,
|
ActionCode: 0,
|
||||||
ErrCode: 200,
|
ErrCode: 200,
|
||||||
@ -413,7 +413,7 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Processing text messages
|
// Processing text messages
|
||||||
if req.ContentType == constant.Text {
|
if req.ContentType == constant.Picture {
|
||||||
user, err := m.userRpcClient.GetUserInfo(c, robotics)
|
user, err := m.userRpcClient.GetUserInfo(c, robotics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(c, "CallbackExample get Sender failed", err)
|
log.ZError(c, "CallbackExample get Sender failed", err)
|
||||||
@ -424,14 +424,21 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
content := make(map[string]any, 1)
|
content := make(map[string]any, 1)
|
||||||
|
|
||||||
// Handle message structures
|
// Handle message structures
|
||||||
text := apistruct.TextElem{}
|
text := apistruct.PictureElem{}
|
||||||
|
log.ZDebug(c, "callback", "contextCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", req.Content)
|
||||||
err = json.Unmarshal([]byte(req.Content), &text)
|
err = json.Unmarshal([]byte(req.Content), &text)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(c, "CallbackExample unmarshal failed", err)
|
log.ZError(c, "CallbackExample unmarshal failed", err)
|
||||||
apiresp.GinError(c, errs.ErrInternalServer.WithDetail(err.Error()).Wrap())
|
apiresp.GinError(c, errs.ErrInternalServer.WithDetail(err.Error()).Wrap())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
content["content"] = text.Content
|
log.ZDebug(c, "callback", "text%TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT", text)
|
||||||
|
content["content"] = text.SourcePath
|
||||||
|
content["sourcePicture"] = text.SourcePicture
|
||||||
|
content["bigPicture"] = text.BigPicture
|
||||||
|
content["snapshotPicture"] = text.SnapshotPicture
|
||||||
|
|
||||||
|
log.ZDebug(c, "callback", "contextAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", content)
|
||||||
|
|
||||||
input := &apistruct.SendMsgReq{
|
input := &apistruct.SendMsgReq{
|
||||||
RecvID: req.SendID,
|
RecvID: req.SendID,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user