mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -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
e8e269b1bb
commit
0d5b9dea00
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