package vo import "encoding/json" type CommonContent struct { Id string `json:"id" gorm:"primary_key"` RelId string `json:"relId"` Content string `json:"content"` State string `json:"state"` } func (article *CommonContent) MarshalBinary() (data []byte, err error) { // encoding.BinaryMarshaler return json.Marshal(article) } func (article *CommonContent) UnmarshalBinary(data []byte) (err error) { return json.Unmarshal(data, article) }