file.go 785 B

12345678910111213141516171819202122232425
  1. package model
  2. import (
  3. "time"
  4. )
  5. // File represents a file in the cloud storage
  6. type File struct {
  7. ID uint `gorm:"primarykey" json:"id"`
  8. Name string `gorm:"size:255;not null" json:"name"`
  9. Path string `gorm:"size:1024;not null" json:"path"`
  10. Size int64 `gorm:"not null" json:"size"`
  11. Type string `gorm:"size:50" json:"type"`
  12. CreatedAt time.Time `json:"created_at"`
  13. UpdatedAt time.Time `json:"updated_at"`
  14. }
  15. // User represents a user in the system
  16. type User struct {
  17. ID uint `gorm:"primarykey" json:"id"`
  18. Username string `gorm:"size:50;uniqueIndex;not null" json:"username"`
  19. Password string `gorm:"size:255;not null" json:"-"`
  20. CreatedAt time.Time `json:"created_at"`
  21. UpdatedAt time.Time `json:"updated_at"`
  22. }