mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 11:06:43 +08:00
callback msg content
This commit is contained in:
parent
ca7bba33e6
commit
0117e96d5b
@ -3,7 +3,6 @@ package callback
|
|||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||||
"github.com/golang/protobuf/jsonpb"
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -11,12 +10,12 @@ func GetContent(msg *server_api_params.MsgData) string {
|
|||||||
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
|
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
|
||||||
var tips server_api_params.TipsComm
|
var tips server_api_params.TipsComm
|
||||||
_ = proto.Unmarshal(msg.Content, &tips)
|
_ = proto.Unmarshal(msg.Content, &tips)
|
||||||
marshaler := jsonpb.Marshaler{
|
//marshaler := jsonpb.Marshaler{
|
||||||
OrigName: true,
|
// OrigName: true,
|
||||||
EnumsAsInts: false,
|
// EnumsAsInts: false,
|
||||||
EmitDefaults: false,
|
// EmitDefaults: false,
|
||||||
}
|
//}
|
||||||
content, _ := marshaler.MarshalToString(&tips)
|
content := tips.JsonDetail
|
||||||
return content
|
return content
|
||||||
} else {
|
} else {
|
||||||
return string(msg.Content)
|
return string(msg.Content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user