stdlib.go 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. UserId string `json:"user_id" gorm:"column:userId"`
  38. DocId string `json:"doc_id" gorm:"column:docId"`
  39. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  40. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  41. DocName string `json:"doc_name" gorm:"column:docName"`
  42. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  43. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  44. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  45. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  46. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  47. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  48. IsDownload int `json:"is_download" gorm:"column:isDownload"`
  49. IsCollection int `json:"is_collection" gorm:"column:isCollection"`
  50. }
  51. func (ud *UserDoc) TableName() string {
  52. return "user_doc"
  53. }
  54. type DocActivity struct {
  55. Id int `json:"id" gorm:"primaryKey"`
  56. DocId string `json:"docId"`
  57. ActivityId int `json:"activityId"`
  58. DocTitle string `json:"docTitle"`
  59. DocSummary string `json:"docSummary"`
  60. DocImg string `json:"docImg"`
  61. Price int `json:"price"`
  62. CostPrice int `json:"costPrice"`
  63. }
  64. func (ud *DocActivity) TableName() string {
  65. return "doc_activity"
  66. }
  67. type UserDocData struct {
  68. Id string `json:"id"`
  69. UserId string `json:"user_id" gorm:"column:userId"`
  70. DocId string `json:"doc_id" gorm:"column:docId"`
  71. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  72. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  73. }
  74. func (ud *UserDocData) TableName() string {
  75. return "user_doc"
  76. }