diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2022-01-01 15:12:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-01 22:12:25 +0800 |
commit | 7db2f110adbd020e70c56497306cfbda8806d109 (patch) | |
tree | 2f5372cc0f1ffde0abb2899b8e262ee33fb84601 /modules/structs/issue_comment.go | |
parent | 549fd03c0e9aa19850c8271cbd7cd62bbc884b34 (diff) | |
download | gitea-7db2f110adbd020e70c56497306cfbda8806d109.tar.gz gitea-7db2f110adbd020e70c56497306cfbda8806d109.zip |
Add API to get issue/pull comments and events (timeline) (#17403)
* Add API to get issue/pull comments and events (timeline)
Adds an API to get both comments and events in one endpoint with all required data.
Closes go-gitea/gitea#13250
* Fix swagger
* Don't show code comments (use review api instead)
* fmt
* Fix comment
* Time -> TrackedTime
* Use var directly
* Add logger
* Fix lint
* Fix test
* Add comments
* fmt
* [test] get issue directly by ID
* Update test
* Add description for changed refs
* Fix build issues + lint
* Fix build
* Use string enums
* Update swagger
* Support `page` and `limit` params
* fmt + swagger
* Use global slices
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/structs/issue_comment.go')
-rw-r--r-- | modules/structs/issue_comment.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/structs/issue_comment.go b/modules/structs/issue_comment.go index 0c8ac20017..e13ec05d01 100644 --- a/modules/structs/issue_comment.go +++ b/modules/structs/issue_comment.go @@ -35,3 +35,48 @@ type EditIssueCommentOption struct { // required: true Body string `json:"body" binding:"Required"` } + +// TimelineComment represents a timeline comment (comment of any type) on a commit or issue +type TimelineComment struct { + ID int64 `json:"id"` + Type string `json:"type"` + + HTMLURL string `json:"html_url"` + PRURL string `json:"pull_request_url"` + IssueURL string `json:"issue_url"` + Poster *User `json:"user"` + Body string `json:"body"` + // swagger:strfmt date-time + Created time.Time `json:"created_at"` + // swagger:strfmt date-time + Updated time.Time `json:"updated_at"` + + OldProjectID int64 `json:"old_project_id"` + ProjectID int64 `json:"project_id"` + OldMilestone *Milestone `json:"old_milestone"` + Milestone *Milestone `json:"milestone"` + TrackedTime *TrackedTime `json:"tracked_time"` + OldTitle string `json:"old_title"` + NewTitle string `json:"new_title"` + OldRef string `json:"old_ref"` + NewRef string `json:"new_ref"` + + RefIssue *Issue `json:"ref_issue"` + RefComment *Comment `json:"ref_comment"` + RefAction string `json:"ref_action"` + // commit SHA where issue/PR was referenced + RefCommitSHA string `json:"ref_commit_sha"` + + ReviewID int64 `json:"review_id"` + + Label *Label `json:"label"` + + Assignee *User `json:"assignee"` + AssigneeTeam *Team `json:"assignee_team"` + // whether the assignees were removed or added + RemovedAssignee bool `json:"removed_assignee"` + + ResolveDoer *User `json:"resolve_doer"` + + DependentIssue *Issue `json:"dependent_issue"` +} |