This commit is contained in:
parent
b33f6c2af7
commit
d33ed051f4
2 changed files with 7 additions and 5 deletions
|
@ -778,14 +778,15 @@ type INotificationDo interface {
|
||||||
UnderlyingDB() *gorm.DB
|
UnderlyingDB() *gorm.DB
|
||||||
schema.Tabler
|
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)
|
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
|
// 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 params []interface{}
|
||||||
|
|
||||||
var generateSQL strings.Builder
|
var generateSQL strings.Builder
|
||||||
|
|
|
@ -22,10 +22,11 @@ type Notification struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type INotification interface {
|
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
|
// 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
|
// Get the lastest count amount of notifications with a given offset for a user
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue