linstrom/storage-new/models/UserToUserRelation.go
mStar ff6a730e58
Some checks failed
/ docker (push) Failing after 2m50s
Follow accept works and messags are pushed as expected
2025-05-10 11:18:28 +02:00

24 lines
733 B
Go

package models
// A relation between two accounts
// There may be multiple relations from an account X to an account Y,
// each describing a different aspect
type UserToUserRelation struct {
ID uint64 `gorm:"primarykey"`
User User // The user X described in [RelationType]
UserId string
TargetUser User // The user Y described in [RelationType]
TargetUserId string
Relation string // `gorm:"type:relation_type"`
}
type IUserToUserRelation interface {
// 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'
GetFollowersForId(id string) ([]string, error)
}