aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs/notifications.go
diff options
context:
space:
mode:
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"
+)