model_object_info.go 1.2 KB

1234567891011121314151617181920212223242526
  1. package viewmodels
  2. import "encoding/json"
  3. type ModelObjectInfo struct {
  4. ModelId int64 `json:"modelId" xorm:"'model_id' bigint pk comment('Model ID') "`
  5. ModelTitle string `json:"modelTitle" xorm:"'model_title' varchar(127) comment('Model Title') "`
  6. ObjectId int64 `json:"objectId" xorm:"'object_id' bigint pk comment('Object ID') "`
  7. ObjectType int64 `json:"objectType" xorm:"'object_type' bigint comment('Object Type') "`
  8. ObjectTitle string `json:"objectTitle" xorm:"'object_title' varchar(127) comment('Object Title') "`
  9. ObjectCode string `json:"objectCode" xorm:"'object_code' varchar(127) comment('Object Code') "`
  10. Comment string `json:"comment" xorm:"'comment' varchar(255) comment('Comment') "`
  11. IsFixed int64 `json:"isFixed" xorm:"'is_fixed' int comment('Is Fixed?') "`
  12. }
  13. func (t *ModelObjectInfo) TableName() string {
  14. return "ds_object"
  15. }
  16. func (t *ModelObjectInfo) MarshalBinary() (data []byte, err error){
  17. return json.Marshal(t)
  18. }
  19. func (t *ModelObjectInfo) UnmarshalBinary(data []byte) (err error){
  20. return json.Unmarshal(data, t)
  21. }