Follow accept works and messags are pushed as expected
Some checks failed
/ docker (push) Failing after 2m50s

This commit is contained in:
Melody Becker 2025-05-10 11:18:28 +02:00
parent 9a3a330b1d
commit ff6a730e58
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
10 changed files with 482 additions and 19 deletions

View file

@ -7,6 +7,7 @@ package dbgen
import (
"context"
"database/sql"
"strings"
"git.mstar.dev/mstar/linstrom/storage-new/models"
"gorm.io/gorm"
@ -587,6 +588,30 @@ type IUserToUserRelationDo interface {
Returning(value interface{}, columns ...string) IUserToUserRelationDo
UnderlyingDB() *gorm.DB
schema.Tabler
GetFollowersForId(id string) (result []string, err error)
}
// SELECT u.inbox_link
// FROM user_to_user_relations r
// LEFT JOIN user_remote_links u
// ON r.user_id = u.user_id
// WHERE
//
// r.target_user_id = @id AND
// r.relation = 'follow'
func (u userToUserRelationDo) GetFollowersForId(id string) (result []string, err error) {
var params []interface{}
var generateSQL strings.Builder
params = append(params, id)
generateSQL.WriteString("SELECT u.inbox_link FROM user_to_user_relations r LEFT JOIN user_remote_links u ON r.user_id = u.user_id WHERE r.target_user_id = ? AND r.relation = 'follow' ")
var executeSQL *gorm.DB
executeSQL = u.UnderlyingDB().Raw(generateSQL.String(), params...).Find(&result) // ignore_security_alert
err = executeSQL.Error
return
}
func (u userToUserRelationDo) Debug() IUserToUserRelationDo {