2020-06-06 00:36:39 +00:00
|
|
|
package notifications
|
|
|
|
|
2020-06-16 11:02:14 +00:00
|
|
|
import (
|
|
|
|
"github.com/statping/statping/types/metrics"
|
|
|
|
"github.com/statping/statping/utils"
|
|
|
|
)
|
2020-06-06 00:36:39 +00:00
|
|
|
|
|
|
|
// AfterFind for Notification will set the timezone
|
|
|
|
func (n *Notification) AfterFind() (err error) {
|
|
|
|
n.CreatedAt = utils.Now()
|
|
|
|
n.UpdatedAt = utils.Now()
|
2020-06-16 11:02:14 +00:00
|
|
|
metrics.Query("notifier", "find")
|
2020-06-06 00:36:39 +00:00
|
|
|
return
|
|
|
|
}
|
2020-06-16 11:02:14 +00:00
|
|
|
|
|
|
|
func (n *Notification) AfterCreate() {
|
|
|
|
metrics.Query("notifier", "create")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *Notification) AfterUpdate() {
|
|
|
|
metrics.Query("notifier", "update")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *Notification) AfterDelete() {
|
|
|
|
metrics.Query("notifier", "delete")
|
|
|
|
}
|