gitea源码

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // Comment represents a comment on a commit or issue
  8. type Comment struct {
  9. // ID is the unique identifier for the comment
  10. ID int64 `json:"id"`
  11. // HTMLURL is the web URL for viewing the comment
  12. HTMLURL string `json:"html_url"`
  13. // PRURL is the API URL for the pull request (if applicable)
  14. PRURL string `json:"pull_request_url"`
  15. // IssueURL is the API URL for the issue
  16. IssueURL string `json:"issue_url"`
  17. // Poster is the user who posted the comment
  18. Poster *User `json:"user"`
  19. // OriginalAuthor is the original author name (for imported comments)
  20. OriginalAuthor string `json:"original_author"`
  21. // OriginalAuthorID is the original author ID (for imported comments)
  22. OriginalAuthorID int64 `json:"original_author_id"`
  23. // Body contains the comment text content
  24. Body string `json:"body"`
  25. // Attachments contains files attached to the comment
  26. Attachments []*Attachment `json:"assets"`
  27. // swagger:strfmt date-time
  28. Created time.Time `json:"created_at"`
  29. // swagger:strfmt date-time
  30. Updated time.Time `json:"updated_at"`
  31. }
  32. // CreateIssueCommentOption options for creating a comment on an issue
  33. type CreateIssueCommentOption struct {
  34. // required:true
  35. // Body is the comment text content
  36. Body string `json:"body" binding:"Required"`
  37. }
  38. // EditIssueCommentOption options for editing a comment
  39. type EditIssueCommentOption struct {
  40. // required: true
  41. // Body is the updated comment text content
  42. Body string `json:"body" binding:"Required"`
  43. }
  44. // TimelineComment represents a timeline comment (comment of any type) on a commit or issue
  45. type TimelineComment struct {
  46. // ID is the unique identifier for the timeline comment
  47. ID int64 `json:"id"`
  48. // Type indicates the type of timeline event
  49. Type string `json:"type"`
  50. // HTMLURL is the web URL for viewing the comment
  51. HTMLURL string `json:"html_url"`
  52. // PRURL is the API URL for the pull request (if applicable)
  53. PRURL string `json:"pull_request_url"`
  54. // IssueURL is the API URL for the issue
  55. IssueURL string `json:"issue_url"`
  56. // Poster is the user who created the timeline event
  57. Poster *User `json:"user"`
  58. // Body contains the timeline event content
  59. Body string `json:"body"`
  60. // swagger:strfmt date-time
  61. Created time.Time `json:"created_at"`
  62. // swagger:strfmt date-time
  63. Updated time.Time `json:"updated_at"`
  64. OldProjectID int64 `json:"old_project_id"`
  65. ProjectID int64 `json:"project_id"`
  66. OldMilestone *Milestone `json:"old_milestone"`
  67. Milestone *Milestone `json:"milestone"`
  68. TrackedTime *TrackedTime `json:"tracked_time"`
  69. OldTitle string `json:"old_title"`
  70. NewTitle string `json:"new_title"`
  71. OldRef string `json:"old_ref"`
  72. NewRef string `json:"new_ref"`
  73. RefIssue *Issue `json:"ref_issue"`
  74. RefComment *Comment `json:"ref_comment"`
  75. RefAction string `json:"ref_action"`
  76. // commit SHA where issue/PR was referenced
  77. RefCommitSHA string `json:"ref_commit_sha"`
  78. ReviewID int64 `json:"review_id"`
  79. Label *Label `json:"label"`
  80. Assignee *User `json:"assignee"`
  81. AssigneeTeam *Team `json:"assignee_team"`
  82. // whether the assignees were removed or added
  83. RemovedAssignee bool `json:"removed_assignee"`
  84. ResolveDoer *User `json:"resolve_doer"`
  85. DependentIssue *Issue `json:"dependent_issue"`
  86. }