houyaf 3 tahun lalu
induk
melakukan
8e384ffe87
1 mengubah file dengan 11 tambahan dan 0 penghapusan
  1. 11 0
      viewmodels/object_data_info.go

+ 11 - 0
viewmodels/object_data_info.go

@@ -1,5 +1,7 @@
 package viewmodels
 
+import "encoding/json"
+
 type ObjectDataInfo struct {
 	ModelId     int64            `json:"modelId"         xorm:"'model_id'        bigint      pk comment('主键ID')     "`
 	ModelTitle  string           `json:"modelTitle"      xorm:"'model_title'     varchar(127)   comment('Model Title')"`
@@ -15,3 +17,12 @@ type ObjectDataInfo struct {
 func (t *ObjectDataInfo) TableName() string {
 	return "ds_object"
 }
+
+
+func (g *ObjectDataInfo) MarshalBinary() (data []byte, err error){
+	return json.Marshal(g)
+}
+
+func (g *ObjectDataInfo) UnmarshalBinary(data []byte) (err error){
+	return json.Unmarshal(data, g)
+}