2021-05-27 11:40:39 +08:00
|
|
|
/*
|
|
|
|
|
** description("").
|
|
|
|
|
** copyright('open-im,www.open-im.io').
|
|
|
|
|
** author("fg,Gordon@tuoyun.net").
|
|
|
|
|
** time(2021/5/27 11:24).
|
|
|
|
|
*/
|
|
|
|
|
package content_struct
|
|
|
|
|
|
2021-06-28 16:25:42 +08:00
|
|
|
import "encoding/json"
|
2021-05-27 11:40:39 +08:00
|
|
|
|
|
|
|
|
type Content struct {
|
|
|
|
|
IsDisplay int32 `json:"isDisplay"`
|
|
|
|
|
ID string `json:"id"`
|
|
|
|
|
Text string `json:"text"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewContentStructString(isDisplay int32, ID string, text string) string {
|
|
|
|
|
c := Content{IsDisplay: isDisplay, ID: ID, Text: text}
|
|
|
|
|
return c.contentToString()
|
|
|
|
|
}
|
|
|
|
|
func (c *Content) contentToString() string {
|
|
|
|
|
data, _ := json.Marshal(c)
|
|
|
|
|
dataString := string(data)
|
|
|
|
|
return dataString
|
|
|
|
|
}
|