mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 02:55:58 +08:00
refactor:Optimization of text messages when accepting message req (#981)
This commit is contained in:
+1
-6
@@ -170,12 +170,7 @@ func (m *MessageApi) getSendMsgReq(c *gin.Context, req apistruct.SendMsg) (sendM
|
||||
log.ZDebug(c, "getSendMsgReq", "req", req.Content)
|
||||
switch req.ContentType {
|
||||
case constant.Text:
|
||||
text, ok := req.Content["text"].(string)
|
||||
if !ok {
|
||||
return nil, errs.ErrArgs.WithDetail("text is not string")
|
||||
}
|
||||
data = apistruct.TextContentElem{Content: text}
|
||||
log.ZDebug(c, "getSendMsgReq", "data", data)
|
||||
data = apistruct.TextElem{}
|
||||
case constant.Picture:
|
||||
data = apistruct.PictureElem{}
|
||||
case constant.Voice:
|
||||
|
||||
Reference in New Issue
Block a user