resource.go 1.1 KB

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