oauth_nest_demo/src/app.controller.ts

27 lines
669 B
TypeScript

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();
}
}