]>
Commit | Line | Data |
---|---|---|
1 | import { Memoize } from '@server/helpers/memoize' | |
2 | import { ServerModel } from '@server/models/server/server' | |
3 | import { ActorModel } from '../../actor' | |
4 | import { ActorFollowModel } from '../../actor-follow' | |
5 | import { ActorImageModel } from '../../actor-image' | |
6 | ||
7 | export class ActorFollowTableAttributes { | |
8 | ||
9 | @Memoize() | |
10 | getFollowAttributes () { | |
11 | return ActorFollowModel.getSQLAttributes('ActorFollowModel').join(', ') | |
12 | } | |
13 | ||
14 | @Memoize() | |
15 | getActorAttributes (actorTableName: string) { | |
16 | return ActorModel.getSQLAttributes(actorTableName, `${actorTableName}.`).join(', ') | |
17 | } | |
18 | ||
19 | @Memoize() | |
20 | getServerAttributes (actorTableName: string) { | |
21 | return ServerModel.getSQLAttributes(`${actorTableName}->Server`, `${actorTableName}.Server.`).join(', ') | |
22 | } | |
23 | ||
24 | @Memoize() | |
25 | getAvatarAttributes (actorTableName: string) { | |
26 | return ActorImageModel.getSQLAttributes(`${actorTableName}->Avatars`, `${actorTableName}.Avatars.`).join(', ') | |
27 | } | |
28 | } |