2024-01-30 09:57:23 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
2024-03-20 12:56:43 +00:00
|
|
|
"git.solsynth.dev/hydrogen/identity/pkg/database"
|
|
|
|
"git.solsynth.dev/hydrogen/identity/pkg/models"
|
2024-01-30 09:57:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent {
|
|
|
|
evt := models.ActionEvent{
|
|
|
|
Type: event,
|
|
|
|
Target: target,
|
|
|
|
IpAddress: ip,
|
|
|
|
UserAgent: ua,
|
|
|
|
AccountID: user.ID,
|
|
|
|
}
|
|
|
|
|
|
|
|
database.C.Save(&evt)
|
|
|
|
|
|
|
|
return evt
|
|
|
|
}
|