resource.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package api
  2. type Resource struct {
  3. ID int `json:"id"`
  4. // Standard fields
  5. CreatorID int `json:"creatorId"`
  6. CreatedTs int64 `json:"createdTs"`
  7. UpdatedTs int64 `json:"updatedTs"`
  8. // Domain specific fields
  9. Filename string `json:"filename"`
  10. Blob []byte `json:"-"`
  11. InternalPath string `json:"-"`
  12. ExternalLink string `json:"externalLink"`
  13. Type string `json:"type"`
  14. Size int64 `json:"size"`
  15. PublicID string `json:"publicId"`
  16. // Related fields
  17. LinkedMemoAmount int `json:"linkedMemoAmount"`
  18. }
  19. type ResourceCreate struct {
  20. // Standard fields
  21. CreatorID int `json:"-"`
  22. // Domain specific fields
  23. Filename string `json:"filename"`
  24. Blob []byte `json:"-"`
  25. InternalPath string `json:"internalPath"`
  26. ExternalLink string `json:"externalLink"`
  27. Type string `json:"type"`
  28. Size int64 `json:"-"`
  29. PublicID string `json:"publicId"`
  30. DownloadToLocal bool `json:"downloadToLocal"`
  31. }
  32. type ResourceFind struct {
  33. ID *int `json:"id"`
  34. // Standard fields
  35. CreatorID *int `json:"creatorId"`
  36. // Domain specific fields
  37. Filename *string `json:"filename"`
  38. MemoID *int
  39. PublicID *string `json:"publicId"`
  40. GetBlob bool
  41. // Pagination
  42. Limit *int
  43. Offset *int
  44. }
  45. type ResourcePatch struct {
  46. ID int `json:"-"`
  47. // Standard fields
  48. UpdatedTs *int64
  49. // Domain specific fields
  50. Filename *string `json:"filename"`
  51. ResetPublicID *bool `json:"resetPublicId"`
  52. PublicID *string `json:"-"`
  53. }
  54. type ResourceDelete struct {
  55. ID int
  56. }