Merge branch 'master' of https://git.cliffbreak.de/Cliffbreak/CliffbreakTS-Viewer
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Marc 2020-09-21 17:51:24 +02:00
commit c0dae98a25
3 changed files with 30 additions and 1 deletions

View file

@ -17,6 +17,7 @@
"fastify", "fastify",
"ijmap", "ijmap",
"nestjs", "nestjs",
"populatedchannel",
"tsviewer", "tsviewer",
"uglifycss", "uglifycss",
"cspacer0" "cspacer0"

View file

@ -1,10 +1,11 @@
import { AppController } from './controllers/app.controller'; import { AppController } from './controllers/app.controller';
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { TeamspeakController } from './controllers/teamspeak.controller';
import { TeamspeakService } from './services/teamspeak.service'; import { TeamspeakService } from './services/teamspeak.service';
@Module({ @Module({
providers: [TeamspeakService], providers: [TeamspeakService],
controllers: [AppController], controllers: [AppController, TeamspeakController],
exports: [], exports: [],
}) })
export class ApplicationModule { } export class ApplicationModule { }

View file

@ -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<IClient[]> {
return this.teamspeakService.getClients();
}
@Get('channels')
async getChannels(): Promise<IChannel[]> {
return this.teamspeakService.getChannels();
}
@Get('populatedChannelList')
async getPopulatedChannelList(): Promise<IPopulatedChannel[]> {
return this.teamspeakService.getPopulatedChannelList();
}
}