gitea源码

attachment.go 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs // import "code.gitea.io/gitea/modules/structs"
  4. import (
  5. "time"
  6. )
  7. // Attachment a generic attachment
  8. // swagger:model
  9. type Attachment struct {
  10. // ID is the unique identifier for the attachment
  11. ID int64 `json:"id"`
  12. // Name is the filename of the attachment
  13. Name string `json:"name"`
  14. // Size is the file size in bytes
  15. Size int64 `json:"size"`
  16. // DownloadCount is the number of times the attachment has been downloaded
  17. DownloadCount int64 `json:"download_count"`
  18. // swagger:strfmt date-time
  19. // Created is the time when the attachment was uploaded
  20. Created time.Time `json:"created_at"`
  21. // UUID is the unique identifier for the attachment file
  22. UUID string `json:"uuid"`
  23. // DownloadURL is the URL to download the attachment
  24. DownloadURL string `json:"browser_download_url"`
  25. }
  26. // EditAttachmentOptions options for editing attachments
  27. // swagger:model
  28. type EditAttachmentOptions struct {
  29. // Name is the new filename for the attachment
  30. Name string `json:"name"`
  31. }