model.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package model
  2. import "time"
  3. // PushMsg is used to push to the mobile clients to indicate the mod name to request
  4. type PushMsg struct {
  5. ResID int `json:"res_id" gorm:"column:id"`
  6. ModID int `json:"mod_id" gorm:"column:pool_id"`
  7. ModName string `json:"mod_name" gorm:"column:name"`
  8. }
  9. // ResourceFile represents the table structure
  10. type ResourceFile struct {
  11. ID int `json:"id"`
  12. Name string `json:"name"`
  13. Type string `json:"type"`
  14. Md5 string `json:"md5"`
  15. Size int `json:"size"`
  16. URL string `json:"url"`
  17. ResourceID int `json:"resource_id"`
  18. Ctime time.Time `json:"ctime"`
  19. Mtime time.Time `json:"mtime"`
  20. FileType int8 `json:"file_type"`
  21. FromVer int64 `json:"from_ver"`
  22. IsDeleted int8 `json:"is_deleted"`
  23. }
  24. //FileInfo : the uploaded file information
  25. type FileInfo struct {
  26. Name string `json:"name"`
  27. Size int64 `json:"size"`
  28. Type string `json:"type"`
  29. Md5 string `json:"md5"`
  30. URL string `json:"url"`
  31. }
  32. // Resource reprensents the resource table
  33. type Resource struct {
  34. ID int64 `json:"id" params:"id"`
  35. Name string `json:"name" params:"name"`
  36. Version int64 `json:"version" params:"version"`
  37. PoolID int64 `json:"pool_id" params:"pool_id"`
  38. Ctime time.Time `json:"ctime" params:"ctime"`
  39. Mtime time.Time `json:"mtime" params:"mtime"`
  40. }