proof of concept

This commit is contained in:
Cubicroot 2021-06-02 17:46:04 +02:00
parent 6c69be7d34
commit 5be204dc19
4 changed files with 65 additions and 0 deletions

View file

@ -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, &notification)
}
func (h *NotificationHandler) DeleteNotification(ctx *gin.Context) {
application := authentication.GetApplication(ctx)
n := model.DeleteNotification{}
h.DP.SendDeleteNotification(application, &n)
}