stdlib.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package model
  2. import (
  3. "time"
  4. )
  5. type UserMoneyRecord 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. CreateAt time.Time `json:"-" gorm:"autoCreateTime"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  29. UpdateAt time.Time `json:"-" gorm:"autoUpdateTime"`
  30. DeletedAt time.Time `json:"-" gorm:"column:delete_at"`
  31. }
  32. func (ud *UserMoneyRecord) TableName() string {
  33. return "doc"
  34. }
  35. type UserDoc struct {
  36. ID int `json:"id" form:"id" gorm:"primaryKey"`
  37. CreateAt time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
  38. UpdateAt time.Time `json:"update_at" gorm:"update_at"`
  39. DeletedAt time.Time `json:"delete_at" gorm:"column:delete_at"`
  40. Id string `json:"id" gorm:"column:id"`
  41. UserId string `json:"user_id" gorm:"column:userId"`
  42. DocId string `json:"doc_id" gorm:"column:docId"`
  43. DocCategory int `json:"doc_category" gorm:"column:docCategory"`
  44. IsDelete int `json:"is_delete" gorm:"column:isDelete"`
  45. DocName string `json:"doc_name" gorm:"column:docName"`
  46. DocFileType int `json:"doc_file_type" gorm:"column:docFileType"`
  47. DocFileSuffix string `json:"doc_file_suffix" gorm:"column:docFileSuffix"`
  48. DocFileSize int `json:"doc_file_size" gorm:"column:docFileSize"`
  49. DocPageSize int `json:"doc_page_size" gorm:"column:docPageSize"`
  50. DocSummary string `json:"doc_summary" gorm:"column:docSummary"`
  51. DocSourceUserId string `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
  52. }
  53. func (ud *UserDoc) TableName() string {
  54. return "user_doc"
  55. }