stdlib.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Doc struct {
  6. Id string `json:"id" gorm:"id"`
  7. UserId string `json:"userId" gorm:"column:userId"`
  8. AppId string `json:"appId" gorm:"column:appId"`
  9. DocName string `json:"docName" gorm:"column:docName"`
  10. DocFileType int `json:"docFileType" gorm:"column:docFileType"`
  11. DocFileSuffix string `json:"docFileSuffix" gorm:"column:docFileSuffix"`
  12. DocFileSize int `json:"docFileSize" gorm:"column:docFileSize"`
  13. DocPageSize int `json:"docPageSize" gorm:"column:docPageSize"`
  14. DocTags string `json:"docTags" gorm:"column:docTags"`
  15. DocClass string `json:"docClass" gorm:"column:docClass"`
  16. UploadDate time.Time `json:"uploadDate" gorm:"column:uploadDate"`
  17. IsDelete int `json:"isDelete" gorm:"column:isDelete"`
  18. OssDocId string `json:"ossDocId" gorm:"column:ossDocId"`
  19. OssDocUrl string `json:"ossDocUrl" gorm:"column:ossDocUrl"`
  20. Md5 string `json:"md5" gorm:"column:md5"`
  21. OssPdfId string `json:"ossPdfId" gorm:"column:ossPdfId"`
  22. OssPdfUrl string `json:"ossPdfUrl" gorm:"column:ossPdfUrl"`
  23. OssTxtId string `json:"ossTxtId" gorm:"column:ossTxtId"`
  24. OssTxtUrl string `json:"ossTxtUrl" gorm:"column:ossTxtUrl"`
  25. Price int `json:"price" gorm:"column:price"`
  26. DownOrUp int `json:"downOrUp" gorm:"column:downOrUp"`
  27. DocSummary string `json:"docSummary" gorm:"column:docSummary"`
  28. PreviewImgId string `json:"preview_img_id" gorm:"column:previewImgId"`
  29. Source int64 `json:"source" gorm:"column:source"` // '文档来源:默认:0:全部;1:剑鱼;2:豆丁;',
  30. ProductType int64 `json:"product_type" gorm:"column:productType"` //'商品类型:默认:0:全部;1:会员免费;2:精品(付费)'
  31. }
  32. func (ud *Doc) TableName() string {
  33. return "doc"
  34. }
  35. type UserDoc struct {
  36. ID int `json:"id" form:"id" gorm:"primaryKey"`
  37. CreateAt time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  38. UpdateAt time.Time `json:"update_at" gorm:"update_at"`
  39. DeletedAt time.Time `json:"delete_at" gorm:"column:delete_at"`
  40. AppId string `json:"app_id" gorm:"column:appId"`
  41. UserId string `json:"user_id" gorm:"column:userId"`
  42. DocId string `json:"doc_id" gorm:"column:docId"`
  43. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  44. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  45. DocName string `json:"doc_name" gorm:"column:docName"`
  46. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  47. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  48. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  49. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  50. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  51. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  52. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  53. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  54. PreviewImgId string `json:"preview_img_id" gorm:"column:previewImgId"`
  55. PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  56. Cost string `json:"cost" gorm:"column:cost"`
  57. Source int64 `json:"source" gorm:"column:source"`
  58. ProductType int64 `json:"product_type" gorm:"column:productType" `
  59. DocTags string `json:"docTags" gorm:"column:docTags"`
  60. }
  61. func (ud *UserDoc) TableName() string {
  62. return "user_doc"
  63. }
  64. type DocActivity struct {
  65. Id int `json:"id" gorm:"primaryKey"`
  66. DocId string `json:"doc_id" gorm:"column:docId"`
  67. ActivityId int `json:"activity_id" gorm:"column:activityId"`
  68. AppId string `json:"app_id" gorm:"column:appId"`
  69. DocTitle string `json:"doc_title" gorm:"column:docTitle"`
  70. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  71. DocImg string `json:"doc_img" gorm:"column:docImg"`
  72. Price int `json:"price" gorm:"column:price"`
  73. CostPrice int `json:"cost_price" gorm:"column:costPrice"`
  74. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  75. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  76. DocFileType int `json:"docFileType" gorm:"column:docFileType"`
  77. UploadDate time.Time `json:"uploadDate" gorm:"column:uploadDate"`
  78. }
  79. func (ud *DocActivity) TableName() string {
  80. return "doc_activity"
  81. }
  82. type UserDocData struct {
  83. Id int `json:"id" gorm:"primaryKey"`
  84. UserId string `json:"user_id" gorm:"column:userId"`
  85. DocId string `json:"doc_id" gorm:"column:docId"`
  86. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  87. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  88. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  89. }
  90. func (ud *UserDocData) TableName() string {
  91. return "user_doc"
  92. }
  93. type DocStatistics struct {
  94. Id int `json:"id"`
  95. AppId string `json:"app_id" gorm:"column:appId"`
  96. DocId string `json:"doc_id" gorm:"column:docId"`
  97. UpdateDate time.Time `json:"update_date" gorm:"column:updateDate"`
  98. score int `json:"score" gorm:"column:score"`
  99. DownTimes int `json:"down_times" gorm:"column:downTimes"`
  100. ViewTimes int `json:"view_times" gorm:"column:viewTimes"`
  101. }
  102. func (ud *DocStatistics) TableName() string {
  103. return "doc_statistics"
  104. }
  105. type InterfaceLog struct {
  106. InterName string `json:"interName" gorm:"column:interName"`
  107. CalleeId string `json:"calleeId" gorm:"column:calleeId"`
  108. AppId string `json:"appId" gorm:"column:appId"`
  109. InParameter string `json:"inParameter" gorm:"column:inParameter"`
  110. ReturnInfo string `json:"returnInfo" gorm:"column:returnInfo"`
  111. Node string `json:"node" gorm:"column:node"`
  112. Summary string `json:"summary" gorm:"column:summary"`
  113. Timestamp time.Time `json:"timestamp" gorm:"column:timestamp"`
  114. }
  115. func (ud *InterfaceLog) TableName() string {
  116. return "interface_log"
  117. }