open-im-server/pkg/utils/callback.go
wangchuxiao c1d6f5809b errcode
2023-01-30 16:55:44 +08:00

19 lines
466 B
Go

package utils
import (
"Open_IM/pkg/common/constant"
server_api_params "Open_IM/pkg/proto/sdk_ws"
"github.com/golang/protobuf/proto"
)
func GetContent(msg *server_api_params.MsgData) string {
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
var tips server_api_params.TipsComm
_ = proto.Unmarshal(msg.Content, &tips)
content := tips.JsonDetail
return content
} else {
return string(msg.Content)
}
}