CliffbreakTS-Viewer/server/src/app/controllers/teamspeak.controller.ts
Simon c4f1a93136
All checks were successful
continuous-integration/drone/push Build is passing
feat(server): add public API
2020-09-21 16:16:31 +02:00

27 lines
No EOL
918 B
TypeScript

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();
}
}