feat(systemWeb.controller.ts): add ping endpoint for server health check response

This commit is contained in:
Jerry 2025-12-08 21:36:41 +08:00
parent 741527410c
commit fec2d1c96d

View File

@ -1,4 +1,4 @@
import { Controller, Post, Inject, UseGuards } from '@nestjs/common'; import { Controller, Post, Get, Inject, UseGuards } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiBody, ApiHeader } from '@nestjs/swagger'; import { ApiTags, ApiOperation, ApiBody, ApiHeader } from '@nestjs/swagger';
import { SystemWebService } from './systemWeb.service'; import { SystemWebService } from './systemWeb.service';
import { TokenAuthGuard } from '../../core/tools/token-auth.guard'; import { TokenAuthGuard } from '../../core/tools/token-auth.guard';
@ -53,4 +53,16 @@ export class SystemWebController {
public async getRestartTime(): Promise<string> { public async getRestartTime(): Promise<string> {
return await this.systemService.getRestartTime(); return await this.systemService.getRestartTime();
} }
/**
* Ping接口
*/
@Get('ping')
@ApiOperation({
summary: 'Ping测试',
description: '嗨,服务器没事',
})
public async ping(): Promise<string> {
return 'pong';
}
} }