database.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. "infish.cn/comm"
  6. )
  7. type DbAsset struct {
  8. Id string `bson:"id,omitempty" json:"id"` //资产id
  9. UserId string `bson:"userId,omitempty" json:"userId"`
  10. Label string `bson:"label,omitempty" json:"label"`
  11. Type int `bson:"type,omitempty" json:"type"` //AssetTypeMesh AssetTypeImage ...
  12. Collection string `bson:"collection,omitempty" json:"collection"` //数据库存储集合
  13. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  14. CategoryIds []string `bson:"categoryIds,omitempty" json:"categoryIds"`
  15. }
  16. type AssetDbConf struct {
  17. Db *Database
  18. AssetConf *DbAsset
  19. }
  20. type Database struct {
  21. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"` //数据库Id
  22. UserId string `bson:"userId,omitempty" json:"userId"` //数据库Id
  23. Name string `bson:"name,omitempty" json:"name"` //数据库名字
  24. Label string `bson:"label,omitempty" json:"label"` //前端展示标签
  25. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  26. Categories *comm.DbCategory `bson:"categories,omitempty" json:"categories"` //数据的分类
  27. Assets []*DbAsset `bson:"assets,omitempty" json:"assets"` //资产定义
  28. }