You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

attachment.go 2.8 kB

3 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package structs // import "code.gitea.io/gitea/modules/structs"
  5. import (
  6. "time"
  7. "code.gitea.io/gitea/modules/timeutil"
  8. )
  9. // Attachment a generic attachment
  10. // swagger:model
  11. type Attachment struct {
  12. ID int64 `json:"id"`
  13. Name string `json:"name"`
  14. Size int64 `json:"size"`
  15. DownloadCount int64 `json:"download_count"`
  16. // swagger:strfmt date-time
  17. Created time.Time `json:"created_at"`
  18. UUID string `json:"uuid"`
  19. DownloadURL string `json:"browser_download_url"`
  20. S3DownloadURL string
  21. }
  22. // EditAttachmentOptions options for editing attachments
  23. // swagger:model
  24. type EditAttachmentOptions struct {
  25. Name string `json:"name"`
  26. }
  27. type Dataset struct {
  28. ID int64 `json:"id"`
  29. Title string `json:"title"`
  30. Status int32 `json:"status"`
  31. Category string `json:"category"`
  32. Description string `json:"description"`
  33. DownloadTimes int64 `json:"downloadTimes"`
  34. UseCount int64 `json:"useCount"`
  35. NumStars int `json:"numStars"`
  36. Recommend bool `json:"recommend"`
  37. License string `json:"license"`
  38. Task string `json:"task"`
  39. ReleaseID int64 `json:"releaseId"`
  40. UserID int64 `json:"userId"`
  41. RepoID int64 `json:"repoId"`
  42. Repo *RepositoryShow `json:"repo"`
  43. CreatedUnix timeutil.TimeStamp `json:"createdUnix"`
  44. UpdatedUnix timeutil.TimeStamp `json:"updatedUnix"`
  45. Attachments []*AttachmentShow `json:"attachments"`
  46. }
  47. type RepositoryShow struct {
  48. OwnerName string `json:"ownerName"`
  49. Name string `json:"name"`
  50. }
  51. type AttachmentShow struct {
  52. ID int64 `json:"id"`
  53. UUID string `json:"uuid"`
  54. DatasetID int64 `json:"datasetId"`
  55. ReleaseID int64 `json:"releaseId"`
  56. UploaderID int64 `json:"uploaderId"`
  57. CommentID int64 `json:"commentId"`
  58. Name string `json:"name"`
  59. Description string `json:"description"`
  60. DownloadCount int64 `json:"downloadCount"`
  61. UseNumber int64 `json:"useNumber"`
  62. Size int64 `json:"size"`
  63. IsPrivate bool `json:"isPrivate"`
  64. DecompressState int32 `json:"decompressState"`
  65. Type int `json:"type"`
  66. CreatedUnix timeutil.TimeStamp `json:"createdUnix"`
  67. }