resource.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. ExternalLink string `json:"externalLink"`
  12. Type string `json:"type"`
  13. Size int64 `json:"size"`
  14. Visibility Visibility `json:"visibility"`
  15. // Related fields
  16. LinkedMemoAmount int `json:"linkedMemoAmount"`
  17. }
  18. type ResourceCreate struct {
  19. // Standard fields
  20. CreatorID int `json:"-"`
  21. // Domain specific fields
  22. Filename string `json:"filename"`
  23. Blob []byte `json:"-"`
  24. ExternalLink string `json:"externalLink"`
  25. Type string `json:"type"`
  26. Size int64 `json:"-"`
  27. Visibility Visibility `json:"visibility"`
  28. }
  29. type ResourceFind struct {
  30. ID *int `json:"id"`
  31. // Standard fields
  32. CreatorID *int `json:"creatorId"`
  33. // Domain specific fields
  34. Filename *string `json:"filename"`
  35. MemoID *int
  36. GetBlob bool
  37. }
  38. type ResourcePatch struct {
  39. ID int `json:"-"`
  40. // Standard fields
  41. UpdatedTs *int64
  42. // Domain specific fields
  43. Filename *string `json:"filename"`
  44. Visibility *Visibility `json:"visibility"`
  45. }
  46. type ResourceDelete struct {
  47. ID int
  48. }