stdlib.go 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  30. }
  31. func (ud *Doc) TableName() string {
  32. return "doc"
  33. }
  34. type UserDoc struct {
  35. ID int `json:"id" form:"id" gorm:"primaryKey"`
  36. CreateAt time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  37. UpdateAt time.Time `json:"update_at" gorm:"update_at"`
  38. DeletedAt time.Time `json:"delete_at" gorm:"column:delete_at"`
  39. AppId string `json:"app_id" gorm:"column:appId"`
  40. UserId string `json:"user_id" gorm:"column:userId"`
  41. DocId string `json:"doc_id" gorm:"column:docId"`
  42. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  43. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  44. DocName string `json:"doc_name" gorm:"column:docName"`
  45. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  46. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  47. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  48. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  49. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  50. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  51. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  52. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  53. PreviewImgId string `json:"preview_img_id" gorm:"column:previewImgId"`
  54. PreviewImgUrl string `json:"preview_img_url" gorm:"column:previewImgUrl"`
  55. Cost string `json:"cost" gorm:"column:cost"`
  56. }
  57. func (ud *UserDoc) TableName() string {
  58. return "user_doc"
  59. }
  60. type DocActivity struct {
  61. Id int `json:"id" gorm:"primaryKey"`
  62. DocId string `json:"doc_id" gorm:"column:docId"`
  63. ActivityId int `json:"activity_id" gorm:"column:activityId"`
  64. AppId string `json:"app_id" gorm:"column:appId"`
  65. DocTitle string `json:"doc_title" gorm:"column:docTitle"`
  66. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  67. DocImg string `json:"doc_img" gorm:"column:docImg"`
  68. Price int `json:"price" gorm:"column:price"`
  69. CostPrice int `json:"cost_price" gorm:"column:costPrice"`
  70. }
  71. func (ud *DocActivity) TableName() string {
  72. return "doc_activity"
  73. }
  74. type UserDocData struct {
  75. Id string `json:"id"`
  76. UserId string `json:"user_id" gorm:"column:userId"`
  77. DocId string `json:"doc_id" gorm:"column:docId"`
  78. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  79. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  80. }
  81. func (ud *UserDocData) TableName() string {
  82. return "user_doc"
  83. }