Fix another gen definition
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Melody Becker 2025-04-04 14:06:47 +02:00
parent d33ed051f4
commit 8f53e8a967
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
2 changed files with 6 additions and 6 deletions

View file

@ -785,13 +785,13 @@ type INotificationDo interface {
// 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 @ids
func (n notificationDo) SetState(state uint8, ids []uint) (err error) {
var params []interface{}
var generateSQL strings.Builder
params = append(params, state)
params = append(params, id)
params = append(params, ids)
generateSQL.WriteString("UPDATE notifications SET viewed_state = ? WHERE id IN ? ")
var executeSQL *gorm.DB
@ -803,7 +803,7 @@ func (n notificationDo) SetState(state uint8, ids []uint) (err error) {
// Get the lastest count amount of notifications with a given offset for a user
//
// SELECT * FROM @@table WHERE for_user_id = @id
// SELECT * FROM @@table WHERE for_user_id = @userId
// ORDER BY id DESC
// {{if count > 0 }}
//
@ -819,7 +819,7 @@ func (n notificationDo) GetLatestWithOffset(userId string, count uint, offset ui
var params []interface{}
var generateSQL strings.Builder
params = append(params, id)
params = append(params, userId)
generateSQL.WriteString("SELECT * FROM notifications WHERE for_user_id = ? ORDER BY id DESC ")
if count > 0 {
params = append(params, count)

View file

@ -25,12 +25,12 @@ type INotification interface {
// 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 @ids
SetState(state uint8, ids ...uint) error
// Get the lastest count amount of notifications with a given offset for a user
//
// SELECT * FROM @@table WHERE for_user_id = @id
// SELECT * FROM @@table WHERE for_user_id = @userId
// ORDER BY id DESC
// {{if count > 0 }}
// LIMIT @count