diff --git a/storage-new/dbgen/notifications.gen.go b/storage-new/dbgen/notifications.gen.go index 097416c..c112467 100644 --- a/storage-new/dbgen/notifications.gen.go +++ b/storage-new/dbgen/notifications.gen.go @@ -778,14 +778,15 @@ type INotificationDo interface { UnderlyingDB() *gorm.DB schema.Tabler - SetState(state NotificationViewedState, ids []uint) (err error) + SetState(state uint8, ids []uint) (err error) GetLatestWithOffset(userId string, count uint, offset uint) (result []models.Notification, err error) } -// Update a given set of notifications to a given viewed state +// Update a given set of notifications to a given viewed state. +// State should be a [NotificationViewedStateType] // // UPDATE @@table SET viewed_state = @state WHERE id IN @id -func (n notificationDo) SetState(state NotificationViewedState, ids []uint) (err error) { +func (n notificationDo) SetState(state uint8, ids []uint) (err error) { var params []interface{} var generateSQL strings.Builder diff --git a/storage-new/models/Notification.go b/storage-new/models/Notification.go index 238a791..9c674ff 100644 --- a/storage-new/models/Notification.go +++ b/storage-new/models/Notification.go @@ -22,10 +22,11 @@ type Notification struct { } type INotification interface { - // Update a given set of notifications to a given viewed state + // Update a given set of notifications to a given viewed state. + // State should be a [NotificationViewedStateType] // // UPDATE @@table SET viewed_state = @state WHERE id IN @id - SetState(state NotificationViewedState, ids ...uint) error + SetState(state uint8, ids ...uint) error // Get the lastest count amount of notifications with a given offset for a user //