summaryrefslogtreecommitdiffstats
path: root/modules/structs/notifications.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-07-01 12:51:24 +0200
committerGitHub <noreply@github.com>2021-07-01 12:51:24 +0200
commitdfa18a8b1c8614f0827d6d2b91171a540a2ca3be (patch)
treea99960ca7b9f0d35e2ccd80cd421899655fea6c3 /modules/structs/notifications.go
parentce286f9d9c00ceb24fb4eab4cab56c0b0678765a (diff)
downloadgitea-dfa18a8b1c8614f0827d6d2b91171a540a2ca3be.tar.gz
gitea-dfa18a8b1c8614f0827d6d2b91171a540a2ca3be.zip
Introduce NotifySubjectType (#16320)
* Introduce NotifySubjectType * update swagger docs
Diffstat (limited to 'modules/structs/notifications.go')
-rw-r--r--modules/structs/notifications.go24
1 files changed, 19 insertions, 5 deletions
diff --git a/modules/structs/notifications.go b/modules/structs/notifications.go
index 8daa6de168..675dcf76b1 100644
--- a/modules/structs/notifications.go
+++ b/modules/structs/notifications.go
@@ -21,14 +21,28 @@ type NotificationThread struct {
// NotificationSubject contains the notification subject (Issue/Pull/Commit)
type NotificationSubject struct {
- Title string `json:"title"`
- URL string `json:"url"`
- LatestCommentURL string `json:"latest_comment_url"`
- Type string `json:"type" binding:"In(Issue,Pull,Commit)"`
- State StateType `json:"state"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+ LatestCommentURL string `json:"latest_comment_url"`
+ Type NotifySubjectType `json:"type" binding:"In(Issue,Pull,Commit)"`
+ State StateType `json:"state"`
}
// NotificationCount number of unread notifications
type NotificationCount struct {
New int64 `json:"new"`
}
+
+// NotifySubjectType represent type of notification subject
+type NotifySubjectType string
+
+const (
+ // NotifySubjectIssue an issue is subject of an notification
+ NotifySubjectIssue NotifySubjectType = "Issue"
+ // NotifySubjectPull an pull is subject of an notification
+ NotifySubjectPull NotifySubjectType = "Pull"
+ // NotifySubjectCommit an commit is subject of an notification
+ NotifySubjectCommit NotifySubjectType = "Commit"
+ // NotifySubjectRepository an repository is subject of an notification
+ NotifySubjectRepository NotifySubjectType = "Repository"
+)