From adc6f76afd31fb700f036b0a854dce2dcd036636 Mon Sep 17 00:00:00 2001 From: luhaoling <2198702716@qq.com> Date: Wed, 17 Jan 2024 17:28:47 +0800 Subject: [PATCH] fix: fix the picture --- internal/api/msg.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index 7601934d5..23a38fcaf 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -442,12 +442,32 @@ func (m *MessageApi) CallbackExample(c *gin.Context) { log.ZDebug(c, "callback", "contextAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", content) - mapStruct, err := convertStructToMap(text) + mapStruct := make(map[string]any) + mapStruct1, err := convertStructToMap(text.SnapshotPicture) + + if err != nil { + log.ZError(c, "CallbackExample struct to map failed", err) + apiresp.GinError(c, errs.ErrInternalServer.WithDetail(err.Error()).Wrap()) + return + } + mapStruct["snapshotPicture"] = mapStruct1 + + mapStruct2, err := convertStructToMap(text.BigPicture) + if err != nil { + log.ZError(c, "CallbackExample struct to map failed", err) + apiresp.GinError(c, errs.ErrInternalServer.WithDetail(err.Error()).Wrap()) + return + } + mapStruct["bigPicture"] = mapStruct2 + + mapStruct3, err := convertStructToMap(text.SourcePicture) if err != nil { log.ZError(c, "CallbackExample struct to map failed", err) apiresp.GinError(c, errs.ErrInternalServer.WithDetail(err.Error()).Wrap()) return } + mapStruct["sourcePicture"] = mapStruct3 + mapStruct["sourcePath"] = text.SourcePath input := &apistruct.SendMsgReq{ RecvID: req.SendID,