stdlib.go 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Doc struct {
  6. Id string `json:"id"`
  7. UserId string `json:"userId"`
  8. DocName string `json:"before"`
  9. DocFileType int `json:"docFileType"`
  10. DocFileSuffix string `json:"docFileSuffix"`
  11. DocFileSize int `json:"docFileSize"`
  12. DocPageSize int `json:"docPageSize"`
  13. DocTags string `json:"docTags"`
  14. DocClassLevelOne string `json:"docClassLevelOne"`
  15. DocClassLevelTwo string `json:"docClassLevelTwo"`
  16. UploadDate string `json:"uploadDate"`
  17. IsDelete int `json:"isDelete"`
  18. OssDocId string `json:"ossDocId"`
  19. OssDocUrl string `json:"ossDocUrl"`
  20. Md5 string `json:"md5"`
  21. OssPdfId string `json:"ossPdfId"`
  22. OssPdfUrl string `json:"ossPdfUrl"`
  23. OssTxtId string `json:"ossTxtId"`
  24. OssTxtUrl string `json:"ossTxtUrl"`
  25. Price int `json:"price"`
  26. DownOrUp int `json:"downOrUp"`
  27. DocSummary string `json:"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. Id string `json:"id" gorm:"column:id"`
  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. }
  50. func (ud *UserDoc) TableName() string {
  51. return "user_doc"
  52. }
  53. type DocActivity struct {
  54. Id int `json:"id" gorm:"primaryKey"`
  55. DocId string `json:"docId"`
  56. ActivityId int `json:"activityId"`
  57. DocTitle string `json:"docTitle"`
  58. DocSummary string `json:"docSummary"`
  59. DocImg string `json:"docImg"`
  60. Price int `json:"price"`
  61. CostPrice int `json:"costPrice"`
  62. }
  63. func (ud *DocActivity) TableName() string {
  64. return "doc_activity"
  65. }