24 lines
733 B
Go
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)
|
|
}
|