import { Controller, Get } from '@nestjs/common'; import { AppService } from './app.service'; import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; @ApiTags('根路由') @Controller() export class AppController { constructor(private readonly appService: AppService) {} @Get() @ApiOperation({ summary: '健康检查', description: '返回应用程序的基本欢迎信息,用于验证服务是否正常运行', }) @ApiResponse({ status: 200, description: '服务运行正常', schema: { type: 'string', example: 'Hello World!', }, }) getHello(): string { return this.appService.getHello(); } }