stdlib.go 3.7 KB

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