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

issue_comment.go 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 int64 `json:"id"`
  10. HTMLURL string `json:"html_url"`
  11. PRURL string `json:"pull_request_url"`
  12. IssueURL string `json:"issue_url"`
  13. Poster *User `json:"user"`
  14. OriginalAuthor string `json:"original_author"`
  15. OriginalAuthorID int64 `json:"original_author_id"`
  16. Body string `json:"body"`
  17. Attachments []*Attachment `json:"assets"`
  18. // swagger:strfmt date-time
  19. Created time.Time `json:"created_at"`
  20. // swagger:strfmt date-time
  21. Updated time.Time `json:"updated_at"`
  22. }
  23. // CreateIssueCommentOption options for creating a comment on an issue
  24. type CreateIssueCommentOption struct {
  25. // required:true
  26. Body string `json:"body" binding:"Required"`
  27. }
  28. // EditIssueCommentOption options for editing a comment
  29. type EditIssueCommentOption struct {
  30. // required: true
  31. Body string `json:"body" binding:"Required"`
  32. }
  33. // TimelineComment represents a timeline comment (comment of any type) on a commit or issue
  34. type TimelineComment struct {
  35. ID int64 `json:"id"`
  36. Type string `json:"type"`
  37. HTMLURL string `json:"html_url"`
  38. PRURL string `json:"pull_request_url"`
  39. IssueURL string `json:"issue_url"`
  40. Poster *User `json:"user"`
  41. Body string `json:"body"`
  42. // swagger:strfmt date-time
  43. Created time.Time `json:"created_at"`
  44. // swagger:strfmt date-time
  45. Updated time.Time `json:"updated_at"`
  46. OldProjectID int64 `json:"old_project_id"`
  47. ProjectID int64 `json:"project_id"`
  48. OldMilestone *Milestone `json:"old_milestone"`
  49. Milestone *Milestone `json:"milestone"`
  50. TrackedTime *TrackedTime `json:"tracked_time"`
  51. OldTitle string `json:"old_title"`
  52. NewTitle string `json:"new_title"`
  53. OldRef string `json:"old_ref"`
  54. NewRef string `json:"new_ref"`
  55. RefIssue *Issue `json:"ref_issue"`
  56. RefComment *Comment `json:"ref_comment"`
  57. RefAction string `json:"ref_action"`
  58. // commit SHA where issue/PR was referenced
  59. RefCommitSHA string `json:"ref_commit_sha"`
  60. ReviewID int64 `json:"review_id"`
  61. Label *Label `json:"label"`
  62. Assignee *User `json:"assignee"`
  63. AssigneeTeam *Team `json:"assignee_team"`
  64. // whether the assignees were removed or added
  65. RemovedAssignee bool `json:"removed_assignee"`
  66. ResolveDoer *User `json:"resolve_doer"`
  67. DependentIssue *Issue `json:"dependent_issue"`
  68. }