aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2022-01-01 15:12:25 +0100
committerGitHub <noreply@github.com>2022-01-01 22:12:25 +0800
commit7db2f110adbd020e70c56497306cfbda8806d109 (patch)
tree2f5372cc0f1ffde0abb2899b8e262ee33fb84601 /models/issue_comment.go
parent549fd03c0e9aa19850c8271cbd7cd62bbc884b34 (diff)
downloadgitea-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 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 360a212a23..9a6f4247b0 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -110,6 +110,47 @@ const (
CommentTypeChangeIssueRef
)
+var commentStrings = []string{
+ "comment",
+ "reopen",
+ "close",
+ "issue_ref",
+ "commit_ref",
+ "comment_ref",
+ "pull_ref",
+ "label",
+ "milestone",
+ "assignees",
+ "change_title",
+ "delete_branch",
+ "start_tracking",
+ "stop_tracking",
+ "add_time_manual",
+ "cancel_tracking",
+ "added_deadline",
+ "modified_deadline",
+ "removed_deadline",
+ "add_dependency",
+ "remove_dependency",
+ "code",
+ "review",
+ "lock",
+ "unlock",
+ "change_target_branch",
+ "delete_time_manual",
+ "review_request",
+ "merge_pull",
+ "pull_push",
+ "project",
+ "project_board",
+ "dismiss_review",
+ "change_issue_ref",
+}
+
+func (t CommentType) String() string {
+ return commentStrings[t]
+}
+
// RoleDescriptor defines comment tag type
type RoleDescriptor int