import { Controller, Get } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { ServerConfigDto, ServerFeaturesDto, ServerInfoResponseDto, ServerMediaTypesResponseDto, ServerPingResponse, ServerStatsResponseDto, ServerThemeDto, ServerVersionResponseDto, } from 'src/dtos/server-info.dto'; import { Authenticated } from 'src/middleware/auth.guard'; import { ServerInfoService } from 'src/services/server-info.service'; @ApiTags('Server Info') @Controller('server-info') export class ServerInfoController { constructor(private service: ServerInfoService) {} @Get() @Authenticated() getServerInfo(): Promise { return this.service.getInfo(); } @Get('ping') pingServer(): ServerPingResponse { return this.service.ping(); } @Get('version') getServerVersion(): ServerVersionResponseDto { return this.service.getVersion(); } @Get('features') getServerFeatures(): Promise { return this.service.getFeatures(); } @Get('theme') getTheme(): Promise { return this.service.getTheme(); } @Get('config') getServerConfig(): Promise { return this.service.getConfig(); } @Authenticated({ admin: true }) @Get('statistics') getServerStatistics(): Promise { return this.service.getStatistics(); } @Get('media-types') getSupportedMediaTypes(): ServerMediaTypesResponseDto { return this.service.getSupportedMediaTypes(); } }