You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package structs
  5. import (
  6. "time"
  7. )
  8. // NotificationThread expose Notification on API
  9. type NotificationThread struct {
  10. ID int64 `json:"id"`
  11. Repository *Repository `json:"repository"`
  12. Subject *NotificationSubject `json:"subject"`
  13. Unread bool `json:"unread"`
  14. Pinned bool `json:"pinned"`
  15. UpdatedAt time.Time `json:"updated_at"`
  16. URL string `json:"url"`
  17. }
  18. // NotificationSubject contains the notification subject (Issue/Pull/Commit)
  19. type NotificationSubject struct {
  20. Title string `json:"title"`
  21. URL string `json:"url"`
  22. LatestCommentURL string `json:"latest_comment_url"`
  23. Type string `json:"type" binding:"In(Issue,Pull,Commit)"`
  24. State StateType `json:"state"`
  25. }
  26. // NotificationCount number of unread notifications
  27. type NotificationCount struct {
  28. New int64 `json:"new"`
  29. }