diff --git a/src/system/system.controller.spec.ts b/src/system/system.controller.spec.ts new file mode 100644 index 0000000..ddd02e9 --- /dev/null +++ b/src/system/system.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { SystemController } from './system.controller'; + +describe('SystemController', () => { + let controller: SystemController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [SystemController], + }).compile(); + + controller = module.get(SystemController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/system/system.controller.ts b/src/system/system.controller.ts new file mode 100644 index 0000000..577544c --- /dev/null +++ b/src/system/system.controller.ts @@ -0,0 +1,16 @@ +import { Controller, Get, UseGuards } from '@nestjs/common'; +import { ApiResponse } from '@nestjs/swagger'; +import { JwtGuard } from 'src/auth/guards/jwt.guard'; + +@Controller('system') +export class SystemController { + @UseGuards(JwtGuard) + @Get('/timestamp') + @ApiResponse({ + description: 'The current ZULU timestamp of the system', + type: String, + }) + async timestamp(): Promise { + return new Date().getTime(); + } +}