resource.go 1021 B

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