stdlib.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Doc struct {
  6. Id string `json:"id" gorm:"column: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. PriceVip int `json:"priceVip" gorm:"column:priceVip"`
  27. DownOrUp int `json:"downOrUp" gorm:"column:downOrUp"`
  28. DocSummary string `json:"docSummary" gorm:"column:docSummary"`
  29. PreviewImgId string `json:"previewImgId" gorm:"column:previewImgId"`
  30. //PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  31. EncryptionLevel int `json:"encryptionLevel" gorm:"column:encryptionLevel"` //
  32. Source int64 `json:"source" gorm:"column:source"` //
  33. ProductType int64 `json:"productType" gorm:"column:productType"` //分类
  34. UpdateDate time.Time `json:"updateDate" gorm:"column:updateDate"`
  35. }
  36. func (ud *Doc) TableName() string {
  37. return "doc"
  38. }
  39. type UserDoc struct {
  40. ID int `json:"id" form:"id" gorm:"primaryKey"`
  41. CreateAt time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  42. UpdateAt time.Time `json:"update_at" gorm:"update_at"`
  43. DeletedAt time.Time `json:"delete_at" gorm:"column:delete_at"`
  44. AppId string `json:"app_id" gorm:"column:appId"`
  45. UserId string `json:"user_id" gorm:"column:userId"`
  46. DocId string `json:"doc_id" gorm:"column:docId"`
  47. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  48. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  49. DocName string `json:"doc_name" gorm:"column:docName"`
  50. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  51. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  52. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  53. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  54. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  55. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  56. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  57. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  58. PreviewImgId string `json:"preview_img_id" gorm:"column:previewImgId"`
  59. PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  60. Cost string `json:"cost" gorm:"column:cost"`
  61. }
  62. type UserDocRes struct {
  63. ID int `json:"id" form:"id" gorm:"primaryKey"`
  64. CreateAt time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  65. UpdateAt time.Time `json:"update_at" gorm:"update_at"`
  66. DeletedAt time.Time `json:"delete_at" gorm:"column:delete_at"`
  67. AppId string `json:"app_id" gorm:"column:appId"`
  68. UserId string `json:"user_id" gorm:"column:userId"`
  69. DocId string `json:"doc_id" gorm:"column:docId"`
  70. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  71. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  72. DocName string `json:"doc_name" gorm:"column:docName"`
  73. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  74. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  75. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  76. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  77. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  78. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  79. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  80. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  81. PreviewImgId string `json:"preview_img_id" gorm:"column:previewImgId"`
  82. PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  83. Cost string `json:"cost" gorm:"column:cost"`
  84. Source int64 `json:"source" gorm:"column:source"`
  85. ProductType int64 `json:"product_type" gorm:"column:productType" `
  86. DocTags string `json:"docTags" gorm:"column:docTags"`
  87. }
  88. func (ud *UserDoc) TableName() string {
  89. return "user_doc"
  90. }
  91. type DocActivity struct {
  92. Id int `json:"id" gorm:"primaryKey"`
  93. DocId string `json:"doc_id" gorm:"column:docId"`
  94. ActivityId int `json:"activity_id" gorm:"column:activityId"`
  95. AppId string `json:"app_id" gorm:"column:appId"`
  96. DocTitle string `json:"doc_title" gorm:"column:docTitle"`
  97. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  98. DocImg string `json:"doc_img" gorm:"column:docImg"`
  99. Price int `json:"price" gorm:"column:price"`
  100. CostPrice int `json:"cost_price" gorm:"column:costPrice"`
  101. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  102. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  103. DocFileType int `json:"docFileType" gorm:"column:docFileType"`
  104. UploadDate time.Time `json:"uploadDate" gorm:"column:uploadDate"`
  105. }
  106. func (ud *DocActivity) TableName() string {
  107. return "doc_activity"
  108. }
  109. type UserDocData struct {
  110. Id int `json:"id" gorm:"primaryKey"`
  111. UserId string `json:"user_id" gorm:"column:userId"`
  112. DocId string `json:"doc_id" gorm:"column:docId"`
  113. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  114. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  115. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  116. }
  117. func (ud *UserDocData) TableName() string {
  118. return "user_doc"
  119. }
  120. type DocStatistics struct {
  121. Id int `json:"id"`
  122. AppId string `json:"appId" gorm:"column:appId"`
  123. DocId string `json:"docId" gorm:"column:docId"`
  124. UpdateDate time.Time `json:"updateDate" gorm:"column:updateDate"`
  125. Score int `json:"score" gorm:"column:score"`
  126. DownTimes int `json:"downTimes" gorm:"column:downTimes"`
  127. ViewTimes int `json:"viewTimes" gorm:"column:viewTimes"`
  128. }
  129. func (ud *DocStatistics) TableName() string {
  130. return "doc_statistics"
  131. }
  132. type InterfaceLog struct {
  133. InterName string `json:"interName" gorm:"column:interName"`
  134. CalleeId string `json:"calleeId" gorm:"column:calleeId"`
  135. AppId string `json:"appId" gorm:"column:appId"`
  136. InParameter string `json:"inParameter" gorm:"column:inParameter"`
  137. ReturnInfo string `json:"returnInfo" gorm:"column:returnInfo"`
  138. Node string `json:"node" gorm:"column:node"`
  139. Summary string `json:"summary" gorm:"column:summary"`
  140. Timestamp time.Time `json:"timestamp" gorm:"column:timestamp"`
  141. }
  142. func (ud *InterfaceLog) TableName() string {
  143. return "interface_log"
  144. }