forked from xiangwang25/whale-town-end-v2
Initial WhaleTown V2 backend
This commit is contained in:
48
src/app.controller.ts
Normal file
48
src/app.controller.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { AppService } from './app.service';
|
||||
import { AppStatusResponseDto, ErrorResponseDto } from './business/shared';
|
||||
|
||||
/**
|
||||
* 应用根控制器
|
||||
*
|
||||
* 功能描述:
|
||||
* - 提供应用基础信息和健康检查接口
|
||||
* - 用于监控服务运行状态
|
||||
*
|
||||
* @author moyin
|
||||
* @version 1.0.0
|
||||
* @since 2025-12-17
|
||||
*/
|
||||
@ApiTags('App')
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
/**
|
||||
* 获取应用状态
|
||||
*
|
||||
* 功能描述:
|
||||
* 返回应用的基本运行状态信息,用于健康检查和监控
|
||||
*
|
||||
* @returns 应用状态信息
|
||||
*/
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
summary: '获取应用状态',
|
||||
description: '返回应用的基本运行状态信息,包括服务名称、版本、运行时间等。用于健康检查和服务监控。'
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: '成功获取应用状态',
|
||||
type: AppStatusResponseDto
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 500,
|
||||
description: '服务器内部错误',
|
||||
type: ErrorResponseDto
|
||||
})
|
||||
getStatus(): AppStatusResponseDto {
|
||||
return this.appService.getStatus();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user