mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-27 05:24:22 -04:00
Docs: Add ApiProperty to all Dtos
This makes it possible for the autogenerated openapi file to contain all the dtos instead of nothing. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
254501d3e5
commit
3620416ed6
14 changed files with 95 additions and 7 deletions
|
@ -38,10 +38,10 @@ async function getServerVersionFromPackageJson(): Promise<ServerVersion> {
|
|||
export class MonitoringService {
|
||||
async getServerStatus(): Promise<ServerStatusDto> {
|
||||
return {
|
||||
connectionSocketQueueLenght: 0,
|
||||
destictOnlineUsers: 0,
|
||||
connectionSocketQueueLength: 0,
|
||||
distinctOnlineUsers: 0,
|
||||
disconnectSocketQueueLength: 0,
|
||||
distictOnlineRegisteredUsers: 0,
|
||||
distinctOnlineRegisteredUsers: 0,
|
||||
isConnectionBusy: false,
|
||||
isDisconnectBusy: false,
|
||||
notesCount: 0,
|
||||
|
|
|
@ -4,25 +4,44 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export interface ServerVersion {
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class ServerVersion {
|
||||
@ApiProperty()
|
||||
major: number;
|
||||
@ApiProperty()
|
||||
minor: number;
|
||||
@ApiProperty()
|
||||
patch: number;
|
||||
@ApiProperty()
|
||||
preRelease?: string;
|
||||
@ApiProperty()
|
||||
commit?: string;
|
||||
}
|
||||
|
||||
export class ServerStatusDto {
|
||||
@ApiProperty()
|
||||
serverVersion: ServerVersion;
|
||||
@ApiProperty()
|
||||
onlineNotes: number;
|
||||
@ApiProperty()
|
||||
onlineUsers: number;
|
||||
destictOnlineUsers: number;
|
||||
@ApiProperty()
|
||||
distinctOnlineUsers: number;
|
||||
@ApiProperty()
|
||||
notesCount: number;
|
||||
@ApiProperty()
|
||||
registeredUsers: number;
|
||||
@ApiProperty()
|
||||
onlineRegisteredUsers: number;
|
||||
distictOnlineRegisteredUsers: number;
|
||||
@ApiProperty()
|
||||
distinctOnlineRegisteredUsers: number;
|
||||
@ApiProperty()
|
||||
isConnectionBusy: boolean;
|
||||
connectionSocketQueueLenght: number;
|
||||
@ApiProperty()
|
||||
connectionSocketQueueLength: number;
|
||||
@ApiProperty()
|
||||
isDisconnectBusy: boolean;
|
||||
@ApiProperty()
|
||||
disconnectSocketQueueLength: number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue