gitea源码

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package structs
  5. // Label a label to an issue or a pr
  6. // swagger:model
  7. type Label struct {
  8. // ID is the unique identifier for the label
  9. ID int64 `json:"id"`
  10. // Name is the display name of the label
  11. Name string `json:"name"`
  12. // example: false
  13. Exclusive bool `json:"exclusive"`
  14. // example: false
  15. IsArchived bool `json:"is_archived"`
  16. // example: 00aabb
  17. Color string `json:"color"`
  18. // Description provides additional context about the label's purpose
  19. Description string `json:"description"`
  20. // URL is the API endpoint for accessing this label
  21. URL string `json:"url"`
  22. }
  23. // CreateLabelOption options for creating a label
  24. type CreateLabelOption struct {
  25. // required:true
  26. // Name is the display name for the new label
  27. Name string `json:"name" binding:"Required"`
  28. // example: false
  29. Exclusive bool `json:"exclusive"`
  30. // required:true
  31. // example: #00aabb
  32. Color string `json:"color" binding:"Required"`
  33. // Description provides additional context about the label's purpose
  34. Description string `json:"description"`
  35. // example: false
  36. IsArchived bool `json:"is_archived"`
  37. }
  38. // EditLabelOption options for editing a label
  39. type EditLabelOption struct {
  40. // Name is the new display name for the label
  41. Name *string `json:"name"`
  42. // example: false
  43. Exclusive *bool `json:"exclusive"`
  44. // example: #00aabb
  45. Color *string `json:"color"`
  46. // Description provides additional context about the label's purpose
  47. Description *string `json:"description"`
  48. // example: false
  49. IsArchived *bool `json:"is_archived"`
  50. }
  51. // IssueLabelsOption a collection of labels
  52. type IssueLabelsOption struct {
  53. // Labels can be a list of integers representing label IDs
  54. // or a list of strings representing label names
  55. Labels []any `json:"labels"`
  56. }
  57. // LabelTemplate info of a Label template
  58. type LabelTemplate struct {
  59. // Name is the display name of the label template
  60. Name string `json:"name"`
  61. // example: false
  62. Exclusive bool `json:"exclusive"`
  63. // example: 00aabb
  64. Color string `json:"color"`
  65. // Description provides additional context about the label template's purpose
  66. Description string `json:"description"`
  67. }