aboutsummaryrefslogtreecommitdiffstats
path: root/modules/references
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 /modules/references
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 'modules/references')
-rw-r--r--modules/references/references.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/references/references.go b/modules/references/references.go
index cfc01cd4c0..74837b8553 100644
--- a/modules/references/references.go
+++ b/modules/references/references.go
@@ -49,6 +49,13 @@ var (
giteaHostInit sync.Once
giteaHost string
giteaIssuePullPattern *regexp.Regexp
+
+ actionStrings = []string{
+ "none",
+ "closes",
+ "reopens",
+ "neutered",
+ }
)
// XRefAction represents the kind of effect a cross reference has once is resolved
@@ -65,6 +72,10 @@ const (
XRefActionNeutered // 3
)
+func (a XRefAction) String() string {
+ return actionStrings[a]
+}
+
// IssueReference contains an unverified cross-reference to a local issue or pull request
type IssueReference struct {
Index int64