mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
fix: fix the valiable unused error
This commit is contained in:
parent
7e43e96beb
commit
a9908988c5
@ -419,7 +419,6 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
mapStruct := make(map[string]any)
|
mapStruct := make(map[string]any)
|
||||||
// Processing text messages
|
// Processing text messages
|
||||||
if req.ContentType == constant.Picture || req.ContentType == constant.Text {
|
if req.ContentType == constant.Picture || req.ContentType == constant.Text {
|
||||||
var err error
|
|
||||||
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)
|
||||||
@ -438,9 +437,6 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
log.ZDebug(c, "callback", "text", text)
|
log.ZDebug(c, "callback", "text", text)
|
||||||
mapStruct["content"] = text.Content
|
mapStruct["content"] = text.Content
|
||||||
} else {
|
} else {
|
||||||
mapStructSnap := make(map[string]interface{})
|
|
||||||
mapStructBig := make(map[string]interface{})
|
|
||||||
mapStructSource := make(map[string]interface{})
|
|
||||||
err = json.Unmarshal([]byte(req.Content), &picture)
|
err = json.Unmarshal([]byte(req.Content), &picture)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(c, "CallbackExample unmarshal failed", err)
|
log.ZError(c, "CallbackExample unmarshal failed", err)
|
||||||
@ -462,24 +458,24 @@ func (m *MessageApi) CallbackExample(c *gin.Context) {
|
|||||||
picture.SnapshotPicture.Type = picture.SourcePicture.Type
|
picture.SnapshotPicture.Type = picture.SourcePicture.Type
|
||||||
}
|
}
|
||||||
|
|
||||||
mapStructSnap, err = convertStructToMap(picture.SnapshotPicture)
|
mapStructSnap := make(map[string]interface{})
|
||||||
if err != nil {
|
if mapStructSnap, err = convertStructToMap(picture.SnapshotPicture); err != nil {
|
||||||
log.ZError(c, "CallbackExample struct to map failed", err)
|
log.ZError(c, "CallbackExample struct to map failed", err)
|
||||||
apiresp.GinError(c, err)
|
apiresp.GinError(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mapStruct["snapshotPicture"] = mapStructSnap
|
mapStruct["snapshotPicture"] = mapStructSnap
|
||||||
|
|
||||||
mapStructBig, err = convertStructToMap(picture.BigPicture)
|
mapStructBig := make(map[string]interface{})
|
||||||
if err != nil {
|
if mapStructBig, err = convertStructToMap(picture.BigPicture); err != nil {
|
||||||
log.ZError(c, "CallbackExample struct to map failed", err)
|
log.ZError(c, "CallbackExample struct to map failed", err)
|
||||||
apiresp.GinError(c, err)
|
apiresp.GinError(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mapStruct["bigPicture"] = mapStructBig
|
mapStruct["bigPicture"] = mapStructBig
|
||||||
|
|
||||||
mapStructSource, err = convertStructToMap(picture.SourcePicture)
|
mapStructSource := make(map[string]interface{})
|
||||||
if err != nil {
|
if mapStructSource, err = convertStructToMap(picture.SourcePicture); err != nil {
|
||||||
log.ZError(c, "CallbackExample struct to map failed", err)
|
log.ZError(c, "CallbackExample struct to map failed", err)
|
||||||
apiresp.GinError(c, err)
|
apiresp.GinError(c, err)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user