mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 00:54:43 -04:00
Refactoring of controllers and service interfaces
DTO should only be used for sending information to and from user. Services now have methods which return normal internal objects and methods which convert them to DTOs. This conversion is done in the controlers Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
3431934ceb
commit
b07d6d478c
8 changed files with 175 additions and 147 deletions
|
@ -8,6 +8,7 @@ import { Controller, Get, UseGuards } from '@nestjs/common';
|
|||
import { MonitoringService } from '../../../monitoring/monitoring.service';
|
||||
import { TokenAuthGuard } from '../../../auth/token-auth.guard';
|
||||
import { ApiSecurity } from '@nestjs/swagger';
|
||||
import { ServerStatusDto } from '../../../monitoring/server-status.dto';
|
||||
|
||||
@ApiSecurity('token')
|
||||
@Controller('monitoring')
|
||||
|
@ -16,7 +17,8 @@ export class MonitoringController {
|
|||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@Get()
|
||||
getStatus() {
|
||||
getStatus() : Promise<ServerStatusDto> {
|
||||
// TODO: toServerStatusDto.
|
||||
return this.monitoringService.getServerStatus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue