Added temperature exceded event
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package notification
|
||||
package messaging
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -12,9 +12,12 @@ type service struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
|
||||
var MessagingChannel chan models.Notification
|
||||
|
||||
func NewService(ch chan models.Notification, db *gorm.DB) service {
|
||||
MessagingChannel = ch
|
||||
return service{
|
||||
ch: ch,
|
||||
ch: MessagingChannel,
|
||||
db: db,
|
||||
}
|
||||
}
|
||||
@@ -28,4 +31,8 @@ func (s service) MessagingService() {
|
||||
fmt.Printf("Error saving notification to DB: %v\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GetMessagingChannel() chan models.Notification {
|
||||
return MessagingChannel
|
||||
}
|
||||
Reference in New Issue
Block a user