picture.go 706 B

1234567891011121314151617181920212223242526
  1. package app
  2. import "time"
  3. type Picture struct {
  4. ID int `json:"id" gorm:"id;comment:id"`
  5. EventId int `json:"eventId" gorm:"event_id;comment:事件id"`
  6. Name string `json:"name" gorm:"name;comment:名称"`
  7. Time time.Time `json:"time" gorm:"time;comment:时间"`
  8. Mime string `json:"mime" gorm:"mime;comment:协议"`
  9. Size int `json:"size" gorm:"size;comment:尺寸"`
  10. DataId int `json:"dataId" gorm:"data_id;comment:数据id"`
  11. }
  12. func (Picture) TableName() string {
  13. return "picture"
  14. }
  15. type PictureData struct {
  16. ID int `json:"id" gorm:"id"`
  17. Data []byte `json:"data" gorm:"data"`
  18. }
  19. func (PictureData) TableName() string {
  20. return "picture_data"
  21. }