]>
Commit | Line | Data |
---|---|---|
eb66ee88 C |
1 | import { Memoize } from '@server/helpers/memoize' |
2 | import { AccountModel } from '@server/models/account/account' | |
3 | import { ActorModel } from '@server/models/actor/actor' | |
4 | import { ActorImageModel } from '@server/models/actor/actor-image' | |
5 | import { ServerModel } from '@server/models/server/server' | |
6 | import { VideoCommentModel } from '../../video-comment' | |
7 | ||
cde3d90d C |
8 | export class VideoCommentTableAttributes { |
9 | ||
eb66ee88 | 10 | @Memoize() |
cde3d90d | 11 | getVideoCommentAttributes () { |
eb66ee88 | 12 | return VideoCommentModel.getSQLAttributes('VideoCommentModel').join(', ') |
cde3d90d C |
13 | } |
14 | ||
eb66ee88 | 15 | @Memoize() |
cde3d90d | 16 | getAccountAttributes () { |
eb66ee88 | 17 | return AccountModel.getSQLAttributes('Account', 'Account.').join(', ') |
cde3d90d C |
18 | } |
19 | ||
eb66ee88 | 20 | @Memoize() |
cde3d90d C |
21 | getVideoAttributes () { |
22 | return [ | |
23 | `"Video"."id" AS "Video.id"`, | |
24 | `"Video"."uuid" AS "Video.uuid"`, | |
25 | `"Video"."name" AS "Video.name"` | |
26 | ].join(', ') | |
27 | } | |
28 | ||
eb66ee88 | 29 | @Memoize() |
cde3d90d | 30 | getActorAttributes () { |
eb66ee88 | 31 | return ActorModel.getSQLAPIAttributes('Account->Actor', `Account.Actor.`).join(', ') |
cde3d90d C |
32 | } |
33 | ||
eb66ee88 | 34 | @Memoize() |
cde3d90d | 35 | getServerAttributes () { |
eb66ee88 | 36 | return ServerModel.getSQLAttributes('Account->Actor->Server', `Account.Actor.Server.`).join(', ') |
cde3d90d C |
37 | } |
38 | ||
eb66ee88 | 39 | @Memoize() |
cde3d90d | 40 | getAvatarAttributes () { |
a8749f7c | 41 | return ActorImageModel.getSQLAttributes('Account->Actor->Avatars', 'Account.Actor.Avatars.').join(', ') |
cde3d90d C |
42 | } |
43 | } |