mirror of
https://github.com/pushbits/server.git
synced 2025-05-20 20:36:33 +02:00
proof of concept
This commit is contained in:
parent
6c69be7d34
commit
5be204dc19
4 changed files with 65 additions and 0 deletions
|
@ -19,6 +19,7 @@ type NotificationDatabase interface {
|
|||
// The NotificationDispatcher interface for relaying notifications.
|
||||
type NotificationDispatcher interface {
|
||||
SendNotification(a *model.Application, n *model.Notification) error
|
||||
SendDeleteNotification(a *model.Application, n *model.DeleteNotification) error
|
||||
}
|
||||
|
||||
// NotificationHandler holds information for processing requests about notifications.
|
||||
|
@ -51,3 +52,11 @@ func (h *NotificationHandler) CreateNotification(ctx *gin.Context) {
|
|||
|
||||
ctx.JSON(http.StatusOK, ¬ification)
|
||||
}
|
||||
|
||||
func (h *NotificationHandler) DeleteNotification(ctx *gin.Context) {
|
||||
application := authentication.GetApplication(ctx)
|
||||
|
||||
n := model.DeleteNotification{}
|
||||
|
||||
h.DP.SendDeleteNotification(application, &n)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue