picture.go 661 B

12345678910111213141516171819202122232425262728
  1. package app
  2. import "time"
  3. type Picture struct {
  4. ID int `json:"id" gorm:"id"`
  5. EventId int `json:"eventId" gorm:"event_id"`
  6. Name string `json:"name" gorm:"name"`
  7. Time time.Time `json:"time" gorm:"time"`
  8. Mime string `json:"mime" gorm:"mime"`
  9. Size int `json:"size" gorm:"size"`
  10. DataId int `json:"dataId" gorm:"data_id"`
  11. }
  12. // TableName Picture 表名
  13. func (Picture) TableName() string {
  14. return "picture"
  15. }
  16. type PictureData struct {
  17. ID int `json:"id" gorm:"id"`
  18. Data []byte `json:"data" gorm:"data"`
  19. }
  20. // TableName PictureData 表名
  21. func (PictureData) TableName() string {
  22. return "picture_data"
  23. }