summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/ChannelsService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-09-18 03:27:08 +0900
committerGitHub <noreply@github.com>2022-09-18 03:27:08 +0900
commitb75184ec8e3436200bacdcd832e3324702553d20 (patch)
tree8b7e316f29e95df921db57289c8b8da476d18f07 /packages/backend/src/server/api/stream/ChannelsService.ts
parentUpdate ROADMAP.md (diff)
downloadsharkey-b75184ec8e3436200bacdcd832e3324702553d20.tar.gz
sharkey-b75184ec8e3436200bacdcd832e3324702553d20.tar.bz2
sharkey-b75184ec8e3436200bacdcd832e3324702553d20.zip
なんかもうめっちゃ変えた
Diffstat (limited to 'packages/backend/src/server/api/stream/ChannelsService.ts')
-rw-r--r--packages/backend/src/server/api/stream/ChannelsService.ts62
1 files changed, 62 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/stream/ChannelsService.ts b/packages/backend/src/server/api/stream/ChannelsService.ts
new file mode 100644
index 0000000000..d6005b1ee8
--- /dev/null
+++ b/packages/backend/src/server/api/stream/ChannelsService.ts
@@ -0,0 +1,62 @@
+import { Inject, Injectable } from '@nestjs/common';
+import { DI } from '@/di-symbols.js';
+import { HybridTimelineChannelService } from './channels/hybrid-timeline.js';
+import { LocalTimelineChannelService } from './channels/local-timeline.js';
+import { HomeTimelineChannelService } from './channels/home-timeline.js';
+import { GlobalTimelineChannelService } from './channels/global-timeline.js';
+import { MainChannelService } from './channels/main.js';
+import { ChannelChannelService } from './channels/channel.js';
+import { AdminChannelService } from './channels/admin.js';
+import { ServerStatsChannelService } from './channels/server-stats.js';
+import { QueueStatsChannelService } from './channels/queue-stats.js';
+import { UserListChannelService } from './channels/user-list.js';
+import { AntennaChannelService } from './channels/antenna.js';
+import { MessagingChannelService } from './channels/messaging.js';
+import { MessagingIndexChannelService } from './channels/messaging-index.js';
+import { DriveChannelService } from './channels/drive.js';
+import { HashtagChannelService } from './channels/hashtag.js';
+
+@Injectable()
+export class ChannelsService {
+ constructor(
+ private mainChannelService: MainChannelService,
+ private homeTimelineChannelService: HomeTimelineChannelService,
+ private localTimelineChannelService: LocalTimelineChannelService,
+ private hybridTimelineChannelService: HybridTimelineChannelService,
+ private globalTimelineChannelService: GlobalTimelineChannelService,
+ private userListChannelService: UserListChannelService,
+ private hashtagChannelService: HashtagChannelService,
+ private antennaChannelService: AntennaChannelService,
+ private channelChannelService: ChannelChannelService,
+ private messagingChannelService: MessagingChannelService,
+ private messagingIndexChannelService: MessagingIndexChannelService,
+ private driveChannelService: DriveChannelService,
+ private serverStatsChannelService: ServerStatsChannelService,
+ private queueStatsChannelService: QueueStatsChannelService,
+ private adminChannelService: AdminChannelService,
+ ) {
+ }
+
+ public getChannelService(name: string) {
+ switch (name) {
+ case 'main': return this.mainChannelService;
+ case 'homeTimeline': return this.homeTimelineChannelService;
+ case 'localTimeline': return this.localTimelineChannelService;
+ case 'hybridTimeline': return this.hybridTimelineChannelService;
+ case 'globalTimeline': return this.globalTimelineChannelService;
+ case 'userList': return this.userListChannelService;
+ case 'hashtag': return this.hashtagChannelService;
+ case 'antenna': return this.antennaChannelService;
+ case 'channel': return this.channelChannelService;
+ case 'messaging': return this.messagingChannelService;
+ case 'messagingIndex': return this.messagingIndexChannelService;
+ case 'drive': return this.driveChannelService;
+ case 'serverStats': return this.serverStatsChannelService;
+ case 'queueStats': return this.queueStatsChannelService;
+ case 'admin': return this.adminChannelService;
+
+ default:
+ throw new Error(`no such channel: ${name}`);
+ }
+ }
+}