diff --git a/.vscode/settings.json b/.vscode/settings.json index 28e8d6e..6d99866 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,6 +17,7 @@ "fastify", "ijmap", "nestjs", + "populatedchannel", "tsviewer", "uglifycss", "cspacer0" diff --git a/server/src/app/app.module.ts b/server/src/app/app.module.ts index 419d2dc..c1afee6 100644 --- a/server/src/app/app.module.ts +++ b/server/src/app/app.module.ts @@ -1,10 +1,11 @@ import { AppController } from './controllers/app.controller'; import { Module } from '@nestjs/common'; +import { TeamspeakController } from './controllers/teamspeak.controller'; import { TeamspeakService } from './services/teamspeak.service'; @Module({ providers: [TeamspeakService], - controllers: [AppController], + controllers: [AppController, TeamspeakController], exports: [], }) export class ApplicationModule { } \ No newline at end of file diff --git a/server/src/app/controllers/teamspeak.controller.ts b/server/src/app/controllers/teamspeak.controller.ts new file mode 100644 index 0000000..1402599 --- /dev/null +++ b/server/src/app/controllers/teamspeak.controller.ts @@ -0,0 +1,27 @@ +import { Controller, Get } from '@nestjs/common'; +import { ApiTags } from '@nestjs/swagger'; +import { IChannel } from '../interfaces/channel.interface'; +import { IClient } from '../interfaces/client.interface'; +import { IPopulatedChannel } from '../interfaces/populatedchannel.interface'; +import { TeamspeakService } from '../services/teamspeak.service'; + +@Controller('api') +@ApiTags('teamspeak') +export class TeamspeakController { + constructor(private teamspeakService: TeamspeakService) {} + + @Get('clients') + async getClients(): Promise { + return this.teamspeakService.getClients(); + } + + @Get('channels') + async getChannels(): Promise { + return this.teamspeakService.getChannels(); + } + + @Get('populatedChannelList') + async getPopulatedChannelList(): Promise { + return this.teamspeakService.getPopulatedChannelList(); + } +} \ No newline at end of file