entity.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package yb_user_collection
  2. import (
  3. "time"
  4. )
  5. // YbUserCollection 研报-用户收藏表
  6. type YbUserCollection struct {
  7. CollectionID int `gorm:"primaryKey;column:collection_id;type:int(10) unsigned;not null" json:"-"`
  8. CollectionType int `gorm:"column:collection_type;type:tinyint(4) unsigned;not null;default:0" json:"collectionType"` // 收藏类型:1-研报; 2-视频社区; 3-微路演视频
  9. UserID int `gorm:"index:idx_user_id;column:user_id;type:int(10) unsigned;not null;default:0" json:"userId"`
  10. RealName string `gorm:"column:real_name;type:varchar(100);not null;default:''" json:"realName"` // 真实姓名
  11. CompanyID int `gorm:"column:company_id;type:int(10) unsigned;not null;default:0" json:"companyId"`
  12. CompanyName string `gorm:"column:company_name;type:varchar(100);not null;default:''" json:"companyName"` // 客户名称
  13. CompanyStatus string `gorm:"column:company_status;type:varchar(30);not null;default:''" json:"companyStatus"`
  14. SellerID int `gorm:"column:seller_id;type:int(11)" json:"sellerId"`
  15. PrimaryID int `gorm:"index:idx_primary_id;column:primary_id;type:int(10) unsigned;not null;default:0" json:"primaryId"` // 不同类型的主ID
  16. ExtendID int `gorm:"index:idx_extend_id;column:extend_id;type:int(10) unsigned;not null;default:0" json:"extendId"` // 扩展ID-如晨周报章节ID
  17. State int `gorm:"column:state;type:tinyint(4) unsigned;not null;default:0" json:"state"` // 状态:1-已收藏;0-取消收藏;
  18. SourceAgent int `gorm:"column:source_agent;type:tinyint(4) unsigned;not null;default:0" json:"sourceAgent"` // 操作来源:1-小程序 2-小程序 PC 3-弘则研究公众号 4-Web PC
  19. Title string `gorm:"column:title;type:varchar(255);not null;default:''" json:"title"` // 研报/视频标题-冗余
  20. PublishTime time.Time `gorm:"column:publish_time;type:datetime" json:"publishTime"` // 研报/视频发布时间-冗余
  21. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"createTime"` // 创建时间
  22. ModifyTime time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"` // 修改时间
  23. }
  24. // TableName get sql table name.获取数据库表名
  25. func (m *YbUserCollection) TableName() string {
  26. return "yb_user_collection"
  27. }
  28. // YbUserCollectionColumns get sql column name.获取数据库列名
  29. var YbUserCollectionColumns = struct {
  30. CollectionID string
  31. CollectionType string
  32. UserID string
  33. PrimaryID string
  34. ExtendID string
  35. State string
  36. SourceAgent string
  37. Title string
  38. PublishTime string
  39. CreateTime string
  40. ModifyTime string
  41. }{
  42. CollectionID: "collection_id",
  43. CollectionType: "collection_type",
  44. UserID: "user_id",
  45. PrimaryID: "primary_id",
  46. ExtendID: "extend_id",
  47. State: "state",
  48. SourceAgent: "source_agent",
  49. Title: "title",
  50. PublishTime: "publish_time",
  51. CreateTime: "create_time",
  52. ModifyTime: "modify_time",
  53. }